@@ -229,7 +229,6 @@ extern mutex_t __usb_mutex;
229
229
static TaskHandle_t __usbTask;
230
230
static void __usb (void *param);
231
231
extern volatile bool __freeRTOSinitted;
232
- static void lwipThread (void *params);
233
232
void startFreeRTOS (void ) {
234
233
235
234
TaskHandle_t c0;
@@ -330,45 +329,14 @@ void vApplicationTickHook(void) {
330
329
#endif /* configUSE_TICK_HOOK == 1 */
331
330
/* -----------------------------------------------------------*/
332
331
333
- #if ( configUSE_MALLOC_FAILED_HOOK == 1 || configCHECK_FOR_STACK_OVERFLOW >= 1 || configDEFAULT_ASSERT == 1 )
334
-
335
- /* *
336
- Private function to enable board led to use it in application hooks
337
- */
338
- void prvSetMainLedOn (void ) {
339
- #ifdef LED_BUILTIN
340
- gpio_init (LED_BUILTIN);
341
- gpio_set_dir (LED_BUILTIN, true );
342
- gpio_put (LED_BUILTIN, true );
343
- #endif
344
- }
345
-
346
- /* *
347
- Private function to blink board led to use it in application hooks
348
- */
349
- void prvBlinkMainLed (void ) {
350
- #ifdef LED_BUILTIN
351
- gpio_put (LED_BUILTIN, !gpio_get (LED_BUILTIN));
352
- #endif
353
- }
354
-
355
- #endif
356
332
357
333
/* ---------------------------------------------------------------------------*\
358
334
Usage:
359
335
called on fatal error (interrupts disabled already)
360
336
\*---------------------------------------------------------------------------*/
361
337
extern " C"
362
338
void rtosFatalError (void ) {
363
- prvSetMainLedOn (); // Main LED on.
364
-
365
- for (;;) {
366
- // Main LED slow flash
367
- sleep_ms (100 );
368
- prvBlinkMainLed ();
369
- sleep_ms (2000 );
370
- prvBlinkMainLed ();
371
- }
339
+ panic (" Fatal error" );
372
340
}
373
341
374
342
#if ( configUSE_MALLOC_FAILED_HOOK == 1 )
@@ -391,12 +359,7 @@ extern "C"
391
359
void vApplicationMallocFailedHook (void ) __attribute__((weak));
392
360
393
361
void vApplicationMallocFailedHook (void ) {
394
- prvSetMainLedOn (); // Main LED on.
395
-
396
- for (;;) {
397
- sleep_ms (50 );
398
- prvBlinkMainLed (); // Main LED fast blink.
399
- }
362
+ panic (" Malloc failed" );
400
363
}
401
364
402
365
#endif /* configUSE_MALLOC_FAILED_HOOK == 1 */
@@ -411,12 +374,7 @@ void vApplicationStackOverflowHook(TaskHandle_t xTask,
411
374
412
375
void vApplicationStackOverflowHook (TaskHandle_t xTask __attribute__ ((unused)),
413
376
char * pcTaskName __attribute__((unused))) {
414
- prvSetMainLedOn (); // Main LED on.
415
-
416
- for (;;) {
417
- sleep_ms (2000 );
418
- prvBlinkMainLed (); // Main LED slow blink.
419
- }
377
+ panic (" Stack overflow" );
420
378
}
421
379
422
380
#endif /* configCHECK_FOR_STACK_OVERFLOW >= 1 */
0 commit comments