// ----------------------------------------------------------------------------- /// @file freeRTOSFixes.c /// @brief Description // ----------------------------------------------------------------------------- // Micro-Key bv // Industrieweg 28, 9804 TG Noordhorn // Postbus 92, 9800 AB Zuidhorn // The Netherlands // Tel: +31 594 503020 // Fax: +31 594 505825 // Email: support@microkey.nl // Web: www.microkey.nl // ----------------------------------------------------------------------------- /// $Revision$ /// $Author$ /// $Date$ // (c) 2017 Micro-Key bv // ----------------------------------------------------------------------------- /// @file freeRTOSFixes.c /// @ingroup {group_name} // ----------------------------------------------------------------------------- // Include files // ----------------------------------------------------------------------------- #include #include #include #include #include "Logger.h" #include "platform.h" // ----------------------------------------------------------------------------- // Constant and macro definitions // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- // Type definitions // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- // File-scope variables // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- // Function declarations // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- // Function definitions // ----------------------------------------------------------------------------- void _init(void) {return;} void OS_logTaskInfo(xTaskHandle taskHandle) { unsigned portBASE_TYPE highWaterMark; char text[128]; snprintf(text, sizeof(text), "***** Task %s", pcTaskGetTaskName(taskHandle)); LOGGER_INFO(mainLog, text); highWaterMark = uxTaskGetStackHighWaterMark(taskHandle); snprintf(text, sizeof(text), "***** Stack high water mark : %lu long words", highWaterMark); LOGGER_INFO(mainLog, text); } // Implementation for libc, needed for printf related functions. caddr_t _sbrk(int incr) { extern char _end; static char* heap_end; char* prev_heap_end; if(heap_end == 0) { heap_end = &_end; } prev_heap_end = heap_end; heap_end += incr; return (caddr_t)prev_heap_end; } // Stack overflow hook void vApplicationStackOverflowHook(xTaskHandle xTask, signed portCHAR* pcTaskName) { LOGGER_ERROR(mainLog, "STACK OVERFLOW IN TASK %s", pcTaskName); } // Malloc failed hook void vApplicationMallocFailedHook(void) { } // Assert for StdPeriph library void assert_failed(uint8_t* file, uint32_t line) { // Logger_log((char*)file, "", line, LOGTYPE_ERROR, "assert failed"); }