Fix compiling with CLI and define most commands away

This commit is contained in:
Raphael Coeffic
2021-11-21 11:18:35 +01:00
committed by Raphael Coeffic
parent 043c1e6a2d
commit 7cfcac3e1e
2 changed files with 124 additions and 119 deletions
+124 -115
View File
@@ -348,11 +348,12 @@ int cliTestNew()
return 0; return 0;
} }
#if 0 // TODO later defined(COLORLCD) #if defined(COLORLCD)
extern bool perMainEnabled; extern bool perMainEnabled;
typedef void (*timedTestFunc_t)(void); typedef void (*timedTestFunc_t)(void);
#if defined(DEBUG_LCD)
void testDrawSolidFilledRectangle() void testDrawSolidFilledRectangle()
{ {
lcdDrawFilledRect(0, 0, LCD_W, LCD_H, SOLID, COLOR_THEME_SECONDARY3); lcdDrawFilledRect(0, 0, LCD_W, LCD_H, SOLID, COLOR_THEME_SECONDARY3);
@@ -365,42 +366,29 @@ void testDrawFilledRectangle()
void testDrawSolidFilledRoundedRectangle() void testDrawSolidFilledRoundedRectangle()
{ {
lcdDrawFilledRect(0, 0, LCD_W/2, LCD_H/2, SOLID, ROUND|COLOR_THEME_SECONDARY3); lcdDrawFilledRect(0, 0, LCD_W / 2, LCD_H / 2, SOLID,
ROUND | COLOR_THEME_SECONDARY3);
} }
void testDrawBlackOverlay() void testDrawBlackOverlay() { lcdDrawBlackOverlay(); }
{
lcdDrawBlackOverlay();
}
void testDrawSolidHorizontalLine1() void testDrawSolidHorizontalLine1() { lcdDrawSolidHorizontalLine(0, 0, 1, 0); }
{
lcdDrawSolidHorizontalLine(0, 0, 1, 0);
}
void testDrawSolidHorizontalLine2() void testDrawSolidHorizontalLine2()
{ {
lcdDrawSolidHorizontalLine(0, 0, LCD_W, 0); lcdDrawSolidHorizontalLine(0, 0, LCD_W, 0);
} }
void testDrawSolidVerticalLine1() void testDrawSolidVerticalLine1() { lcdDrawSolidVerticalLine(0, 0, 1, 0); }
{
lcdDrawSolidVerticalLine(0, 0, 1, 0);
}
void testDrawSolidVerticalLine2() void testDrawSolidVerticalLine2() { lcdDrawSolidVerticalLine(0, 0, LCD_H, 0); }
{
lcdDrawSolidVerticalLine(0, 0, LCD_H, 0);
}
void testDrawDiagonalLine() void testDrawDiagonalLine()
{ {
lcdDrawLine(0,0, LCD_W, LCD_H, SOLID, COLOR_THEME_SECONDARY1); lcdDrawLine(0, 0, LCD_W, LCD_H, SOLID, COLOR_THEME_SECONDARY1);
} }
void testEmpty() void testEmpty() {}
{
}
void testDrawRect() void testDrawRect()
{ {
@@ -409,35 +397,38 @@ void testDrawRect()
void testDrawText() void testDrawText()
{ {
lcdDrawText(0, LCD_H/2, "The quick brown fox jumps over the lazy dog", COLOR_THEME_SECONDARY1); lcdDrawText(0, LCD_H / 2, "The quick brown fox jumps over the lazy dog",
COLOR_THEME_SECONDARY1);
} }
void testDrawTextVertical() void testDrawTextVertical()
{ {
lcdDrawText(30, LCD_H, "The quick brown fox ", COLOR_THEME_SECONDARY1|VERTICAL); lcdDrawText(30, LCD_H, "The quick brown fox ",
COLOR_THEME_SECONDARY1 | VERTICAL);
} }
void testClear() void testClear() { lcdClear(); }
{
lcdClear();
}
#define RUN_GRAPHICS_TEST(name, runtime) runTimedFunctionTest(name, #name, runtime, 100) #define RUN_GRAPHICS_TEST(name, runtime) \
runTimedFunctionTest(name, #name, runtime, 100)
float runTimedFunctionTest(timedTestFunc_t func, const char * name, uint32_t runtime, uint16_t step) float runTimedFunctionTest(timedTestFunc_t func, const char *name,
uint32_t runtime, uint16_t step)
{ {
const uint32_t start = RTOS_GET_MS(); const uint32_t start = RTOS_GET_MS();
uint32_t noRuns = 0; uint32_t noRuns = 0;
uint32_t actualRuntime = 0; uint32_t actualRuntime = 0;
while ((actualRuntime = RTOS_GET_MS() - start) < runtime ) { while ((actualRuntime = RTOS_GET_MS() - start) < runtime) {
for (uint16_t n=0; n < step; n++) { for (uint16_t n = 0; n < step; n++) {
func(); func();
} }
lcdRefresh(); lcdRefresh();
noRuns += step; noRuns += step;
} }
const float result = (noRuns * 500.0f) / (float)actualRuntime; // runs/second const float result = (noRuns * 500.0f) / (float)actualRuntime; // runs/second
serialPrint("Test %s speed: %lu.%02u, (%lu runs in %lu ms)", name, uint32_t(result), uint16_t((result - uint32_t(result)) * 100.0f), noRuns, actualRuntime); serialPrint("Test %s speed: %lu.%02u, (%lu runs in %lu ms)", name,
uint32_t(result), uint16_t((result - uint32_t(result)) * 100.0f),
noRuns, actualRuntime);
RTOS_WAIT_MS(200); RTOS_WAIT_MS(200);
return result; return result;
} }
@@ -447,7 +438,7 @@ int cliTestGraphics()
serialPrint("Starting graphics performance test..."); serialPrint("Starting graphics performance test...");
RTOS_WAIT_MS(200); RTOS_WAIT_MS(200);
watchdogSuspend(6000/*60s*/); watchdogSuspend(6000 /*60s*/);
if (pulsesStarted()) { if (pulsesStarted()) {
pausePulses(); pausePulses();
} }
@@ -470,7 +461,8 @@ int cliTestGraphics()
result += RUN_GRAPHICS_TEST(testDrawTextVertical, 1000); result += RUN_GRAPHICS_TEST(testDrawTextVertical, 1000);
result += RUN_GRAPHICS_TEST(testClear, 1000); result += RUN_GRAPHICS_TEST(testClear, 1000);
serialPrint("Total speed: %lu.%02u", uint32_t(result), uint16_t((result - uint32_t(result)) * 100.0f)); serialPrint("Total speed: %lu.%02u", uint32_t(result),
uint16_t((result - uint32_t(result)) * 100.0f));
perMainEnabled = true; perMainEnabled = true;
if (pulsesStarted()) { if (pulsesStarted()) {
@@ -481,46 +473,47 @@ int cliTestGraphics()
return 0; return 0;
} }
#endif
void memoryRead(const uint8_t * src, uint32_t size) #if defined(DEBUG_RAM)
void memoryRead(const uint8_t *src, uint32_t size)
{ {
// uint8_t data; // uint8_t data;
while(size--) { while (size--) {
/*data =*/ *(const uint8_t volatile *)src; /*data =*/*(const uint8_t volatile *)src;
++src; ++src;
} }
} }
void memoryRead(const uint32_t * src, uint32_t size) void memoryRead(const uint32_t *src, uint32_t size)
{ {
while(size--) { while (size--) {
*(const uint32_t volatile *)src; *(const uint32_t volatile *)src;
++src; ++src;
} }
} }
uint32_t * testbuff[100]; uint32_t *testbuff[100];
void memoryCopy(uint8_t * dest, const uint8_t * src, uint32_t size) void memoryCopy(uint8_t *dest, const uint8_t *src, uint32_t size)
{ {
while(size--) { while (size--) {
*dest = *src; *dest = *src;
++src; ++src;
++dest; ++dest;
} }
} }
void memoryCopy(uint32_t * dest, const uint32_t * src, uint32_t size) void memoryCopy(uint32_t *dest, const uint32_t *src, uint32_t size)
{ {
while(size--) { while (size--) {
*dest = *src; *dest = *src;
++src; ++src;
++dest; ++dest;
} }
} }
#define MEMORY_SPEED_BLOCK_SIZE (4*1024) #define MEMORY_SPEED_BLOCK_SIZE (4 * 1024)
void testMemoryReadFrom_RAM_8bit() void testMemoryReadFrom_RAM_8bit()
{ {
@@ -529,7 +522,7 @@ void testMemoryReadFrom_RAM_8bit()
void testMemoryReadFrom_RAM_32bit() void testMemoryReadFrom_RAM_32bit()
{ {
memoryRead((const uint32_t *)0x20000000, MEMORY_SPEED_BLOCK_SIZE/4); memoryRead((const uint32_t *)0x20000000, MEMORY_SPEED_BLOCK_SIZE / 4);
} }
void testMemoryReadFrom_SDRAM_8bit() void testMemoryReadFrom_SDRAM_8bit()
@@ -539,41 +532,46 @@ void testMemoryReadFrom_SDRAM_8bit()
void testMemoryReadFrom_SDRAM_32bit() void testMemoryReadFrom_SDRAM_32bit()
{ {
memoryRead((const uint32_t *)0xD0000000, MEMORY_SPEED_BLOCK_SIZE/4); memoryRead((const uint32_t *)0xD0000000, MEMORY_SPEED_BLOCK_SIZE / 4);
} }
extern uint8_t * LCD_FIRST_FRAME_BUFFER; extern uint8_t *LCD_FIRST_FRAME_BUFFER;
extern uint8_t * LCD_SECOND_FRAME_BUFFER; extern uint8_t *LCD_SECOND_FRAME_BUFFER;
void testMemoryCopyFrom_RAM_to_SDRAM_32bit() void testMemoryCopyFrom_RAM_to_SDRAM_32bit()
{ {
memoryCopy((uint32_t *)LCD_FIRST_FRAME_BUFFER, (const uint32_t * )cliLastLine, MEMORY_SPEED_BLOCK_SIZE/4); memoryCopy((uint32_t *)LCD_FIRST_FRAME_BUFFER, (const uint32_t *)cliLastLine,
MEMORY_SPEED_BLOCK_SIZE / 4);
} }
void testMemoryCopyFrom_RAM_to_SDRAM_8bit() void testMemoryCopyFrom_RAM_to_SDRAM_8bit()
{ {
memoryCopy((uint8_t *)LCD_FIRST_FRAME_BUFFER, (const uint8_t * )cliLastLine, MEMORY_SPEED_BLOCK_SIZE); memoryCopy((uint8_t *)LCD_FIRST_FRAME_BUFFER, (const uint8_t *)cliLastLine,
MEMORY_SPEED_BLOCK_SIZE);
} }
void testMemoryCopyFrom_SDRAM_to_SDRAM_32bit() void testMemoryCopyFrom_SDRAM_to_SDRAM_32bit()
{ {
memoryCopy((uint32_t *)LCD_FIRST_FRAME_BUFFER, (const uint32_t * )LCD_SECOND_FRAME_BUFFER, MEMORY_SPEED_BLOCK_SIZE/4); memoryCopy((uint32_t *)LCD_FIRST_FRAME_BUFFER,
(const uint32_t *)LCD_SECOND_FRAME_BUFFER,
MEMORY_SPEED_BLOCK_SIZE / 4);
} }
void testMemoryCopyFrom_SDRAM_to_SDRAM_8bit() void testMemoryCopyFrom_SDRAM_to_SDRAM_8bit()
{ {
memoryCopy((uint8_t *)LCD_FIRST_FRAME_BUFFER, (const uint8_t * )LCD_SECOND_FRAME_BUFFER, MEMORY_SPEED_BLOCK_SIZE); memoryCopy((uint8_t *)LCD_FIRST_FRAME_BUFFER,
(const uint8_t *)LCD_SECOND_FRAME_BUFFER, MEMORY_SPEED_BLOCK_SIZE);
} }
#define RUN_MEMORY_TEST(name, runtime) runTimedFunctionTest(name, #name, runtime, 100) #define RUN_MEMORY_TEST(name, runtime) \
runTimedFunctionTest(name, #name, runtime, 100)
int cliTestMemorySpeed() int cliTestMemorySpeed()
{ {
serialPrint("Starting memory speed test..."); serialPrint("Starting memory speed test...");
RTOS_WAIT_MS(200); RTOS_WAIT_MS(200);
watchdogSuspend(6000/*60s*/); watchdogSuspend(6000 /*60s*/);
if (pulsesStarted()) { if (pulsesStarted()) {
pausePulses(); pausePulses();
} }
@@ -603,7 +601,8 @@ int cliTestMemorySpeed()
result += RUN_MEMORY_TEST(testMemoryCopyFrom_SDRAM_to_SDRAM_8bit, 200); result += RUN_MEMORY_TEST(testMemoryCopyFrom_SDRAM_to_SDRAM_8bit, 200);
result += RUN_MEMORY_TEST(testMemoryCopyFrom_SDRAM_to_SDRAM_32bit, 200); result += RUN_MEMORY_TEST(testMemoryCopyFrom_SDRAM_to_SDRAM_32bit, 200);
serialPrint("Total speed: %lu.%02u", uint32_t(result), uint16_t((result - uint32_t(result)) * 100.0f)); serialPrint("Total speed: %lu.%02u", uint32_t(result),
uint16_t((result - uint32_t(result)) * 100.0f));
LTDC_Cmd(ENABLE); LTDC_Cmd(ENABLE);
@@ -616,7 +615,9 @@ int cliTestMemorySpeed()
return 0; return 0;
} }
#endif
#if defined(DEBUG_MODELSLIST)
#include "modelslist.h" #include "modelslist.h"
using std::list; using std::list;
@@ -625,56 +626,59 @@ int cliTestModelsList()
ModelsList modList; ModelsList modList;
modList.load(); modList.load();
int count=0; int count = 0;
serialPrint("Starting fetching RF data 100x..."); serialPrint("Starting fetching RF data 100x...");
const uint32_t start = RTOS_GET_MS(); const uint32_t start = RTOS_GET_MS();
const list<ModelsCategory*>& cats = modList.getCategories(); const list<ModelsCategory *> &cats = modList.getCategories();
while(1) { while (1) {
for (list<ModelsCategory*>::const_iterator cat_it = cats.begin(); for (list<ModelsCategory *>::const_iterator cat_it = cats.begin();
cat_it != cats.end(); ++cat_it) { cat_it != cats.end(); ++cat_it) {
for (ModelsCategory::iterator mod_it = (*cat_it)->begin(); for (ModelsCategory::iterator mod_it = (*cat_it)->begin();
mod_it != (*cat_it)->end(); mod_it++) { mod_it != (*cat_it)->end(); mod_it++) {
if (!(*mod_it)->fetchRfData()) { if (!(*mod_it)->fetchRfData()) {
serialPrint("Error while fetching RF data..."); serialPrint("Error while fetching RF data...");
return 0; return 0;
} }
if (++count >= 100) if (++count >= 100) goto done;
goto done;
} }
} }
} }
done: done:
serialPrint("Done fetching %ix RF data: %lu ms", count, (RTOS_GET_MS() - start)); serialPrint("Done fetching %ix RF data: %lu ms", count,
(RTOS_GET_MS() - start));
return 0; return 0;
} }
#endif
#endif // #if defined(COLORLCD) #endif // #if defined(COLORLCD)
#if defined(DEBUG)
int cliTest(const char ** argv) int cliTest(const char ** argv)
{ {
if (!strcmp(argv[1], "new")) { if (!strcmp(argv[1], "new")) {
return cliTestNew(); return cliTestNew();
} }
else if (!strcmp(argv[1], "std::exception")) { #if defined(COLORLCD)
serialPrint("Not implemented"); #if defined(DEBUG_LCD)
}
#if 0 // TODO later defined(COLORLCD)
else if (!strcmp(argv[1], "graphics")) { else if (!strcmp(argv[1], "graphics")) {
return cliTestGraphics(); return cliTestGraphics();
} }
#endif
#if defined(DEBUG_RAM)
else if (!strcmp(argv[1], "memspd")) { else if (!strcmp(argv[1], "memspd")) {
return cliTestMemorySpeed(); return cliTestMemorySpeed();
} }
#endif
#if defined(DEBUG_MODELSLIST)
else if (!strcmp(argv[1], "modelslist")) { else if (!strcmp(argv[1], "modelslist")) {
return cliTestModelsList(); return cliTestModelsList();
} }
#endif
#endif #endif
else { else {
serialPrint("%s: Invalid argument \"%s\"", argv[0], argv[1]); serialPrint("%s: Invalid argument \"%s\"", argv[0], argv[1]);
@@ -682,7 +686,6 @@ int cliTest(const char ** argv)
return 0; return 0;
} }
#if defined(DEBUG)
int cliTrace(const char ** argv) int cliTrace(const char ** argv)
{ {
if (!strcmp(argv[1], "on")) { if (!strcmp(argv[1], "on")) {
@@ -696,7 +699,6 @@ int cliTrace(const char ** argv)
} }
return 0; return 0;
} }
#endif
int cliStackInfo(const char ** argv) int cliStackInfo(const char ** argv)
{ {
@@ -756,6 +758,7 @@ int cliMemoryInfo(const char ** argv)
#endif #endif
return 0; return 0;
} }
#endif
int cliReboot(const char ** argv) int cliReboot(const char ** argv)
{ {
@@ -786,23 +789,26 @@ const MemArea memAreas[] = {
{ nullptr, nullptr, 0 }, { nullptr, nullptr, 0 },
}; };
int cliSet(const char ** argv) int cliSet(const char **argv)
{ {
if (!strcmp(argv[1], "rtc")) { if (!strcmp(argv[1], "rtc")) {
struct gtm t; struct gtm t;
int year, month, day, hour, minute, second; int year, month, day, hour, minute, second;
if (toInt(argv, 2, &year) > 0 && toInt(argv, 3, &month) > 0 && toInt(argv, 4, &day) > 0 && toInt(argv, 5, &hour) > 0 && toInt(argv, 6, &minute) > 0 && toInt(argv, 7, &second) > 0) { if (toInt(argv, 2, &year) > 0 && toInt(argv, 3, &month) > 0 &&
t.tm_year = year-TM_YEAR_BASE; toInt(argv, 4, &day) > 0 && toInt(argv, 5, &hour) > 0 &&
t.tm_mon = month-1; toInt(argv, 6, &minute) > 0 && toInt(argv, 7, &second) > 0) {
t.tm_year = year - TM_YEAR_BASE;
t.tm_mon = month - 1;
t.tm_mday = day; t.tm_mday = day;
t.tm_hour = hour; t.tm_hour = hour;
t.tm_min = minute; t.tm_min = minute;
t.tm_sec = second; t.tm_sec = second;
g_rtcTime = gmktime(&t); // update local timestamp and get wday calculated g_rtcTime =
gmktime(&t); // update local timestamp and get wday calculated
rtcSetTime(&t); rtcSetTime(&t);
} } else {
else { serialPrint("%s: Invalid arguments \"%s\" \"%s\"", argv[0], argv[1],
serialPrint("%s: Invalid arguments \"%s\" \"%s\"", argv[0], argv[1], argv[2]); argv[2]);
} }
} }
#if !defined(SOFTWARE_VOLUME) #if !defined(SOFTWARE_VOLUME)
@@ -810,9 +816,9 @@ int cliSet(const char ** argv)
int level = 0; int level = 0;
if (toInt(argv, 2, &level) > 0) { if (toInt(argv, 2, &level) > 0) {
setVolume(level); setVolume(level);
} } else {
else { serialPrint("%s: Invalid argument \"%s\" \"%s\"", argv[0], argv[1],
serialPrint("%s: Invalid argument \"%s\" \"%s\"", argv[0], argv[1], argv[2]); argv[2]);
} }
return 0; return 0;
} }
@@ -820,7 +826,6 @@ int cliSet(const char ** argv)
return 0; return 0;
} }
#if defined(DEBUG_INTERRUPTS) #if defined(DEBUG_INTERRUPTS)
void printInterrupts() void printInterrupts()
{ {
@@ -837,7 +842,6 @@ void printInterrupts()
#endif //#if defined(DEBUG_INTERRUPTS) #endif //#if defined(DEBUG_INTERRUPTS)
#if defined(DEBUG_TASKS) #if defined(DEBUG_TASKS)
void printTaskSwitchLog() void printTaskSwitchLog()
{ {
serialPrint("Tasks legend [<task_id>, <task name>]:"); serialPrint("Tasks legend [<task_id>, <task name>]:");
@@ -888,7 +892,6 @@ void printTaskSwitchLog()
#endif // #if defined(DEBUG_TASKS) #endif // #if defined(DEBUG_TASKS)
#if defined(DEBUG_TIMERS) #if defined(DEBUG_TIMERS)
void printDebugTime(uint32_t time) void printDebugTime(uint32_t time)
{ {
if (time >= 30000) { if (time >= 30000) {
@@ -916,34 +919,37 @@ void printDebugTimers()
} }
#endif #endif
#include "OsMutex.h" #if defined(DEBUG_AUDIO)
extern RTOS_MUTEX_HANDLE audioMutex;
void printAudioVars() void printAudioVars()
{ {
for(int n = 0; n < AUDIO_BUFFER_COUNT; n++) { for (int n = 0; n < AUDIO_BUFFER_COUNT; n++) {
serialPrint("Audio Buffer %d: size: %u, ", n, (uint32_t)audioBuffers[n].size); serialPrint("Audio Buffer %d: size: %u, ", n,
(uint32_t)audioBuffers[n].size);
dump((uint8_t *)audioBuffers[n].data, 32); dump((uint8_t *)audioBuffers[n].data, 32);
} }
serialPrint("fragments:"); serialPrint("fragments:");
for(int n = 0; n < AUDIO_QUEUE_LENGTH; n++) { for (int n = 0; n < AUDIO_QUEUE_LENGTH; n++) {
serialPrint("%d: type %u: id: %u, repeat: %u, ", n, (uint32_t)audioQueue.fragmentsFifo.fragments[n].type, serialPrint("%d: type %u: id: %u, repeat: %u, ", n,
(uint32_t)audioQueue.fragmentsFifo.fragments[n].id, (uint32_t)audioQueue.fragmentsFifo.fragments[n].type,
(uint32_t)audioQueue.fragmentsFifo.fragments[n].repeat); (uint32_t)audioQueue.fragmentsFifo.fragments[n].id,
if ( audioQueue.fragmentsFifo.fragments[n].type == FRAGMENT_FILE) { (uint32_t)audioQueue.fragmentsFifo.fragments[n].repeat);
if (audioQueue.fragmentsFifo.fragments[n].type == FRAGMENT_FILE) {
serialPrint(" file: %s", audioQueue.fragmentsFifo.fragments[n].file); serialPrint(" file: %s", audioQueue.fragmentsFifo.fragments[n].file);
} }
} }
serialPrint("FragmentFifo: ridx: %d, widx: %d", audioQueue.fragmentsFifo.ridx, audioQueue.fragmentsFifo.widx); serialPrint("FragmentFifo: ridx: %d, widx: %d",
serialPrint("audioQueue: readIdx: %d, writeIdx: %d, full: %d", audioQueue.buffersFifo.readIdx, audioQueue.buffersFifo.writeIdx, audioQueue.buffersFifo.bufferFull); audioQueue.fragmentsFifo.ridx, audioQueue.fragmentsFifo.widx);
serialPrint("audioQueue: readIdx: %d, writeIdx: %d, full: %d",
audioQueue.buffersFifo.readIdx, audioQueue.buffersFifo.writeIdx,
audioQueue.buffersFifo.bufferFull);
serialPrint("normalContext: %u", (uint32_t)audioQueue.normalContext.fragment.type); serialPrint("normalContext: %u",
(uint32_t)audioQueue.normalContext.fragment.type);
serialPrint("audioMutex[%u] = %u", (uint32_t)audioMutex, (uint32_t)MutexTbl[audioMutex].mutexFlag);
} }
#endif
#if defined(DEBUG)
int cliDisplay(const char ** argv) int cliDisplay(const char ** argv)
{ {
long long int address = 0; long long int address = 0;
@@ -1102,7 +1108,9 @@ int cliDebugVars(const char ** argv)
return 0; return 0;
} }
#endif
#if defined(DEBUG)
int cliRepeat(const char ** argv) int cliRepeat(const char ** argv)
{ {
int interval = 0; int interval = 0;
@@ -1124,6 +1132,7 @@ int cliRepeat(const char ** argv)
} }
return 0; return 0;
} }
#endif
#if defined(JITTER_MEASURE) #if defined(JITTER_MEASURE)
int cliShowJitter(const char ** argv) int cliShowJitter(const char ** argv)
@@ -1194,7 +1203,7 @@ int cliBlueTooth(const char ** argv)
} }
#endif #endif
#if defined(ACCESS_DENIED) #if defined(ACCESS_DENIED) && defined(DEBUG_CRYPT)
extern "C" { extern "C" {
#include "AccessDenied/access_denied.h" #include "AccessDenied/access_denied.h"
@@ -1252,19 +1261,19 @@ const CliCommand cliCommands[] = {
{ "readsd", cliReadSD, "<start sector> <sectors count> <read buffer size (sectors)>" }, { "readsd", cliReadSD, "<start sector> <sectors count> <read buffer size (sectors)>" },
{ "testsd", cliTestSD, "" }, { "testsd", cliTestSD, "" },
{ "play", cliPlay, "<filename>" }, { "play", cliPlay, "<filename>" },
{ "print", cliDisplay, "<address> [<size>] | <what>" },
{ "p", cliDisplay, "<address> [<size>] | <what>" },
{ "reboot", cliReboot, "[wdt]" }, { "reboot", cliReboot, "[wdt]" },
{ "set", cliSet, "<what> <value>" }, { "set", cliSet, "<what> <value>" },
#if defined(DEBUG)
{ "print", cliDisplay, "<address> [<size>] | <what>" },
{ "p", cliDisplay, "<address> [<size>] | <what>" },
{ "stackinfo", cliStackInfo, "" }, { "stackinfo", cliStackInfo, "" },
{ "meminfo", cliMemoryInfo, "" }, { "meminfo", cliMemoryInfo, "" },
{ "test", cliTest, "new | std::exception | graphics | memspd" }, { "test", cliTest, "new | graphics | memspd" },
#if defined(DEBUG)
{ "trace", cliTrace, "on | off" }, { "trace", cliTrace, "on | off" },
#endif
{ "help", cliHelp, "[<command>]" },
{ "debugvars", cliDebugVars, "" }, { "debugvars", cliDebugVars, "" },
{ "repeat", cliRepeat, "<interval> <command>" }, { "repeat", cliRepeat, "<interval> <command>" },
#endif
{ "help", cliHelp, "[<command>]" },
#if defined(JITTER_MEASURE) #if defined(JITTER_MEASURE)
{ "jitter", cliShowJitter, "" }, { "jitter", cliShowJitter, "" },
#endif #endif
@@ -1274,7 +1283,7 @@ const CliCommand cliCommands[] = {
#if defined(BLUETOOTH) #if defined(BLUETOOTH)
{ "bt", cliBlueTooth, "<baudrate>|<command>" }, { "bt", cliBlueTooth, "<baudrate>|<command>" },
#endif #endif
#if defined(ACCESS_DENIED) #if defined(ACCESS_DENIED) && defined(DEBUG_CRYPT)
{ "crypt", cliCrypt, "<string to be encrypted>" }, { "crypt", cliCrypt, "<string to be encrypted>" },
#endif #endif
{ nullptr, nullptr, nullptr } /* sentinel */ { nullptr, nullptr, nullptr } /* sentinel */
-4
View File
@@ -29,11 +29,7 @@
#define CRLF "\r\n" #define CRLF "\r\n"
#if defined(CLI)
#include "cli.h"
#else
#include "serial.h" #include "serial.h"
#endif
extern volatile uint32_t g_tmr10ms; extern volatile uint32_t g_tmr10ms;