Compilation fix

This commit is contained in:
Bertrand Songis
2015-09-05 11:37:09 +02:00
parent d14931f77f
commit 976c01051d
5 changed files with 29 additions and 31 deletions
+6 -6
View File
@@ -158,24 +158,24 @@ int cliStackInfo(const char ** argv)
int total = 0; int total = 0;
switch(tid) { switch(tid) {
case MENU_TASK_INDEX: case MENU_TASK_INDEX:
total = menusStack.getSize(); total = menusStack.size();
available = menusStack.available(); available = menusStack.available();
break; break;
case MIXER_TASK_INDEX: case MIXER_TASK_INDEX:
total = mixerStack.getSize(); total = mixerStack.size();
available = mixerStack.available(); available = mixerStack.available();
break; break;
case AUDIO_TASK_INDEX: case AUDIO_TASK_INDEX:
total = audioStack.getSize(); total = audioStack.size();
available = audioStack.available(); available = audioStack.available();
break; break;
case CLI_TASK_INDEX: case CLI_TASK_INDEX:
total = cliStack.getSize(); total = cliStack.size();
available = cliStack.available(); available = cliStack.available();
break; break;
case MAIN_TASK_INDEX: case MAIN_TASK_INDEX:
total = mainStackAvailable(); total = stackAvailable();
available = mainStackSize(); available = stackSize();
break; break;
default: default:
break; break;
+1 -1
View File
@@ -195,7 +195,7 @@ void menuStatisticsDebug(uint8_t event)
lcd_putsAtt(lcdLastPos+2, MENU_DEBUG_Y_RTOS+1, "[A]", SMLSIZE); lcd_putsAtt(lcdLastPos+2, MENU_DEBUG_Y_RTOS+1, "[A]", SMLSIZE);
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS, audioStack.available(), UNSIGN|LEFT); lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS, audioStack.available(), UNSIGN|LEFT);
lcd_putsAtt(lcdLastPos+2, MENU_DEBUG_Y_RTOS+1, "[I]", SMLSIZE); lcd_putsAtt(lcdLastPos+2, MENU_DEBUG_Y_RTOS+1, "[I]", SMLSIZE);
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS, mainStackAvailable(), UNSIGN|LEFT); lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS, stackAvailable(), UNSIGN|LEFT);
lcd_puts(3*FW, 7*FH+1, STR_MENUTORESET); lcd_puts(3*FW, 7*FH+1, STR_MENUTORESET);
lcd_status_line(); lcd_status_line();
-2
View File
@@ -657,12 +657,10 @@ void eepromWriteBlock(uint8_t * pointer_ram, uint32_t pointer_eeprom, uint32_t s
#endif #endif
#if !defined(CPUARM)
uint16_t stackAvailable() uint16_t stackAvailable()
{ {
return 500; return 500;
} }
#endif
#if 0 #if 0
static void EeFsDump(){ static void EeFsDump(){
+16 -16
View File
@@ -75,34 +75,34 @@ enum TaskIndex {
MAIN_TASK_INDEX = 255 MAIN_TASK_INDEX = 255
}; };
template<int size> template<int SIZE>
void TaskStack<size>::paint() void TaskStack<SIZE>::paint()
{ {
for (uint32_t i=0; i<size; i++) { for (uint32_t i=0; i<SIZE; i++) {
stack[i] = 0x55555555; stack[i] = 0x55555555;
} }
} }
template<int size> template<int SIZE>
uint32_t TaskStack<size>::getSize() uint16_t TaskStack<SIZE>::size()
{ {
return size; return SIZE*4;
} }
uint32_t getStackAvailable(void * address, uint32_t size) uint16_t getStackAvailable(void * address, uint16_t size)
{ {
uint32_t * array = (uint32_t *)address; uint32_t * array = (uint32_t *)address;
uint32_t i = 0; uint16_t i = 0;
while (i < size && array[i] == 0x55555555) { while (i < size && array[i] == 0x55555555) {
i++; i++;
} }
return i*4; return i*4;
} }
template<int size> template<int SIZE>
uint32_t TaskStack<size>::available() uint16_t TaskStack<SIZE>::available()
{ {
return getStackAvailable(stack, size); return getStackAvailable(stack, SIZE);
} }
void stackPaint() void stackPaint()
@@ -115,15 +115,15 @@ void stackPaint()
#endif #endif
} }
#if defined(CPUSTM32) #if defined(CPUSTM32) && !defined(SIMU)
uint32_t mainStackSize() uint16_t stackSize()
{ {
return ((unsigned char *)&_estack - (unsigned char *)&_main_stack_start) / 4; return ((unsigned char *)&_estack - (unsigned char *)&_main_stack_start) / 4;
} }
uint32_t mainStackAvailable() uint16_t stackAvailable()
{ {
return getStackAvailable(&_main_stack_start, mainStackSize()); return getStackAvailable(&_main_stack_start, stackSize());
} }
#endif #endif
@@ -216,7 +216,7 @@ void tasksStart()
#endif #endif
#if defined(BLUETOOTH) #if defined(BLUETOOTH)
btTaskId = CoCreateTask(btTask, NULL, 15, &bluetoothStack[BLUETOOTH_STACK_SIZE-1], BLUETOOTH_STACK_SIZE); btTaskId = CoCreateTask(btTask, NULL, 15, &bluetoothStack.stack[BLUETOOTH_STACK_SIZE-1], BLUETOOTH_STACK_SIZE);
#endif #endif
mixerTaskId = CoCreateTask(mixerTask, NULL, 5, &mixerStack.stack[MIXER_STACK_SIZE-1], MIXER_STACK_SIZE); mixerTaskId = CoCreateTask(mixerTask, NULL, 5, &mixerStack.stack[MIXER_STACK_SIZE-1], MIXER_STACK_SIZE);
+6 -6
View File
@@ -43,19 +43,19 @@ extern "C" {
} }
#endif #endif
template<int size> template<int SIZE>
class TaskStack class TaskStack
{ {
public: public:
TaskStack() { } TaskStack() { }
void paint(); void paint();
uint32_t getSize(); uint16_t size();
uint32_t available(); uint16_t available();
OS_STK stack[size]; OS_STK stack[SIZE];
}; };
void stackPaint(); void stackPaint();
uint32_t mainStackSize(); uint16_t stackSize();
uint32_t mainStackAvailable(); uint16_t stackAvailable();
#endif // _TASKS_ARM_H_ #endif // _TASKS_ARM_H_