- 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:
mmi
2017-09-12 11:09:10 +00:00
parent 2da1629f62
commit 0742755ad5
854 changed files with 267498 additions and 0 deletions

View File

@@ -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");
}