Cosmetics
This commit is contained in:
+1
-1
@@ -699,7 +699,7 @@ int cliTrace(const char ** argv)
|
||||
|
||||
int cliStackInfo(const char ** argv)
|
||||
{
|
||||
serialPrint("[MAIN] %d available / %d", stackAvailable(), stackSize() * 4); // stackSize() returns size in 32bit chunks
|
||||
serialPrint("[MAIN] %d available / %d", stackAvailable(), stackSize());
|
||||
serialPrint("[MENUS] %d available / %d", menusStack.available(), menusStack.size());
|
||||
serialPrint("[MIXER] %d available / %d", mixerStack.available(), mixerStack.size());
|
||||
serialPrint("[AUDIO] %d available / %d", audioStack.available(), audioStack.size());
|
||||
|
||||
@@ -229,11 +229,11 @@ void menuStatisticsDebug(event_t event)
|
||||
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_MIXMAX, "ms");
|
||||
|
||||
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_RTOS, STR_FREESTACKMINB);
|
||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS, menusStack.available(), LEFT);
|
||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS, menusStack.available(), LEFT|SMLSIZE);
|
||||
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_RTOS, "/");
|
||||
lcdDrawNumber(lcdLastRightPos+1, MENU_DEBUG_Y_RTOS, mixerStack.available(), LEFT);
|
||||
lcdDrawNumber(lcdLastRightPos+1, MENU_DEBUG_Y_RTOS, mixerStack.available(), LEFT|SMLSIZE);
|
||||
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_RTOS, "/");
|
||||
lcdDrawNumber(lcdLastRightPos+1, MENU_DEBUG_Y_RTOS, audioStack.available(), LEFT);
|
||||
lcdDrawNumber(lcdLastRightPos+1, MENU_DEBUG_Y_RTOS, audioStack.available(), LEFT|SMLSIZE);
|
||||
|
||||
lcdDrawText(4*FW, 7*FH+1, STR_MENUTORESET);
|
||||
lcdInvertLastLine();
|
||||
|
||||
@@ -404,8 +404,12 @@ void FrskyDeviceFirmwareUpdate::flashFirmware(const char * filename)
|
||||
resumePulses();
|
||||
}
|
||||
|
||||
#define CHIP_FIRMWARE_UPDATE_TIMEOUT 20000 /* 20s */
|
||||
|
||||
const char * FrskyChipFirmwareUpdate::waitAnswer(uint8_t & status)
|
||||
{
|
||||
watchdogSuspend(CHIP_FIRMWARE_UPDATE_TIMEOUT);
|
||||
|
||||
telemetryPortSetDirectionInput();
|
||||
|
||||
uint8_t buffer[12];
|
||||
@@ -422,7 +426,7 @@ const char * FrskyChipFirmwareUpdate::waitAnswer(uint8_t & status)
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (++retry == 20000) {
|
||||
if (++retry == CHIP_FIRMWARE_UPDATE_TIMEOUT) {
|
||||
return "No answer";
|
||||
}
|
||||
RTOS_WAIT_MS(1);
|
||||
|
||||
+10
-10
@@ -99,12 +99,12 @@ extern "C++" {
|
||||
{
|
||||
}
|
||||
|
||||
uint16_t size()
|
||||
uint32_t size()
|
||||
{
|
||||
return SIZE;
|
||||
}
|
||||
|
||||
uint16_t available()
|
||||
uint32_t available()
|
||||
{
|
||||
return SIZE / 2;
|
||||
}
|
||||
@@ -121,7 +121,7 @@ extern "C++" {
|
||||
|
||||
#define TASK_RETURN() return nullptr
|
||||
|
||||
constexpr uint16_t stackAvailable()
|
||||
constexpr uint32_t stackAvailable()
|
||||
{
|
||||
return 500;
|
||||
}
|
||||
@@ -199,24 +199,24 @@ extern "C++" {
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
static inline uint16_t getStackAvailable(void * address, uint16_t size)
|
||||
static inline uint32_t getStackAvailable(void * address, uint32_t size)
|
||||
{
|
||||
uint32_t * array = (uint32_t *)address;
|
||||
uint16_t i = 0;
|
||||
uint32_t i = 0;
|
||||
while (i < size && array[i] == 0x55555555) {
|
||||
i++;
|
||||
}
|
||||
return i*4;
|
||||
return i;
|
||||
}
|
||||
|
||||
extern int _estack;
|
||||
extern int _main_stack_start;
|
||||
static inline uint16_t stackSize()
|
||||
static inline uint32_t stackSize()
|
||||
{
|
||||
return ((unsigned char *)&_estack - (unsigned char *)&_main_stack_start) / 4;
|
||||
}
|
||||
|
||||
static inline uint16_t stackAvailable()
|
||||
static inline uint32_t stackAvailable()
|
||||
{
|
||||
return getStackAvailable(&_main_stack_start, stackSize());
|
||||
}
|
||||
@@ -240,12 +240,12 @@ extern "C++" {
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t size()
|
||||
uint32_t size()
|
||||
{
|
||||
return SIZE * 4;
|
||||
}
|
||||
|
||||
uint16_t available()
|
||||
uint32_t available()
|
||||
{
|
||||
return getStackAvailable(stack, SIZE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user