rtos clean up, remove yield at the end of loop()
This commit is contained in:
1 parent
1b2b85c421
commit
8045b1ec74
5 files changed
+13
-19
No files matched your search
@@ -76,7 +76,7 @@
|
||||
#define configUSE_IDLE_HOOK 1
|
||||
#define configUSE_TICK_HOOK 0
|
||||
#define configCHECK_FOR_STACK_OVERFLOW 1
|
||||
#define configUSE_MALLOC_FAILED_HOOK (CFG_DEBUG > 0 ? 1 : 0)
|
||||
#define configUSE_MALLOC_FAILED_HOOK 1
|
||||
|
||||
/* Run time and task stats gathering related definitions. */
|
||||
#define configGENERATE_RUN_TIME_STATS 0
|
||||
|
||||
+1
-3
@@ -51,6 +51,7 @@ static void loop_task(void* arg)
|
||||
// If Serial is not begin(), call it to avoid hard fault
|
||||
if ( !Serial ) Serial.begin(115200);
|
||||
dbgPrintVersion();
|
||||
// dbgMemInfo();
|
||||
Bluefruit_printInfo();
|
||||
#endif
|
||||
|
||||
@@ -64,9 +65,6 @@ static void loop_task(void* arg)
|
||||
|
||||
// Serial events
|
||||
if (serialEvent && serialEventRun) serialEventRun();
|
||||
|
||||
// To compatible with most code where loop is not rtos-aware
|
||||
taskYIELD(); // vTaskDelay(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+10
-4
@@ -43,7 +43,6 @@ void yield(void)
|
||||
taskYIELD();
|
||||
}
|
||||
|
||||
|
||||
static void _redirect_task(void* arg)
|
||||
{
|
||||
SchedulerRTOS::taskfunc_t taskfunc = (SchedulerRTOS::taskfunc_t) arg;
|
||||
@@ -51,9 +50,6 @@ static void _redirect_task(void* arg)
|
||||
while(1)
|
||||
{
|
||||
taskfunc();
|
||||
|
||||
// yield() anyway just in case user forgot
|
||||
taskYIELD();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,6 +87,16 @@ bool SchedulerRTOS::startLoop(taskfunc_t task, const char* name, uint32_t stack_
|
||||
extern "C"
|
||||
{
|
||||
|
||||
void vApplicationStackOverflowHook( TaskHandle_t xTask, char *pcTaskName )
|
||||
{
|
||||
LOG_LV1("RTOS", "%s Stack Overflow !!!", pcTaskName);
|
||||
}
|
||||
|
||||
void vApplicationMallocFailedHook(void)
|
||||
{
|
||||
LOG_LV1("RTOS", "Failed to Malloc");
|
||||
}
|
||||
|
||||
void vApplicationIdleHook( void )
|
||||
{
|
||||
// Internal background task
|
||||
|
||||
@@ -125,7 +125,7 @@ Revision: $Rev: 12706 $
|
||||
// or define SEGGER_RTT_LOCK() to completely disable interrupts.
|
||||
//
|
||||
|
||||
#define SEGGER_RTT_MAX_INTERRUPT_PRIORITY (0x20) // Interrupt priority to lock on SEGGER_RTT_LOCK on Cortex-M3/4 (Default: 0x20)
|
||||
#define SEGGER_RTT_MAX_INTERRUPT_PRIORITY (2 << 5) // Interrupt priority to lock on SEGGER_RTT_LOCK on Cortex-M3/4 (Default: 0x20)
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
|
||||
@@ -71,16 +71,6 @@ int cprintf(const char * format, ...)
|
||||
return len;
|
||||
}
|
||||
|
||||
void vApplicationMallocFailedHook(void)
|
||||
{
|
||||
cprintf("Failed to Malloc");
|
||||
}
|
||||
|
||||
void vApplicationStackOverflowHook( TaskHandle_t xTask, char *pcTaskName )
|
||||
{
|
||||
cprintf("%s Stack Overflow !!!", pcTaskName);
|
||||
}
|
||||
|
||||
int dbgHeapTotal(void)
|
||||
{
|
||||
return ((uint32_t) __HeapLimit) - ((uint32_t) __HeapBase);
|
||||
|
||||
Reference in new issue
Block a user