- Set-up the project file structure
- Added STM standard peripheral library - Added FreeRTOS - Added FreeRTOS fixes and config - Added main.c Set up makefile structure and implemented makefiles for STM library and the hsb-mrts project Todo: HAL makefiles git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@167 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
/// @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 <unistd.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "freeRTOSFixes.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\n", pcTaskGetTaskName(taskHandle));
|
||||
// Shell_sendString(text);
|
||||
|
||||
highWaterMark = uxTaskGetStackHighWaterMark(taskHandle);
|
||||
// snprintf(text, sizeof(text), "Stack high water mark : %lu long words\n", highWaterMark);
|
||||
// Shell_sendString(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_fatal(FATALCODE_STACKOVERFLOW);
|
||||
}
|
||||
|
||||
// Malloc failed hook
|
||||
void vApplicationMallocFailedHook(void)
|
||||
{
|
||||
// Logger_fatal(FATALCODE_MALLOCFAILED);
|
||||
}
|
||||
|
||||
// Assert for StdPeriph library
|
||||
void assert_failed(uint8_t* file, uint32_t line)
|
||||
{
|
||||
// Logger_log((char*)file, "", line, LOGTYPE_ERROR, "assert failed");
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
/// @file main.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 main.c
|
||||
/// @ingroup {group_name}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Include files
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// FreeRTOS includes
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
|
||||
#include "freeRTOSFixes.h"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Constant and macro definitions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/* The time between cycles of the 'check' functionality (defined within the
|
||||
tick hook. */
|
||||
#define mainCHECK_DELAY ( ( TickType_t ) 5000 / portTICK_PERIOD_MS )
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Type definitions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// File-scope variables
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/* Variable that counts at 20KHz to provide the time base for the run time
|
||||
stats. */
|
||||
unsigned long ulRunTimeStatsClock = 0UL;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Function declarations
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Function definitions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
int main (void)
|
||||
{
|
||||
|
||||
|
||||
/* Start the scheduler. */
|
||||
vTaskStartScheduler();
|
||||
|
||||
/* Will only get here if there was insufficient memory to create the idle
|
||||
task. The idle task is created within vTaskStartScheduler(). */
|
||||
for( ;; );
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
void vApplicationTickHook ()
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user