mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-23 06:51:58 -04:00
SmartFusion A2F demo work in progress.
This commit is contained in:
parent
f11836f206
commit
51f445fc67
|
@ -69,6 +69,12 @@
|
||||||
#ifndef FREERTOS_CONFIG_H
|
#ifndef FREERTOS_CONFIG_H
|
||||||
#define FREERTOS_CONFIG_H
|
#define FREERTOS_CONFIG_H
|
||||||
|
|
||||||
|
#ifdef __ICCARM__
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
extern uint32_t SystemFrequency;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*-----------------------------------------------------------
|
/*-----------------------------------------------------------
|
||||||
* Application specific definitions.
|
* Application specific definitions.
|
||||||
*
|
*
|
||||||
|
@ -81,10 +87,11 @@
|
||||||
* See http://www.freertos.org/a00110.html.
|
* See http://www.freertos.org/a00110.html.
|
||||||
*----------------------------------------------------------*/
|
*----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
#define configUSE_PREEMPTION 1
|
#define configUSE_PREEMPTION 1
|
||||||
#define configUSE_IDLE_HOOK 1
|
#define configUSE_IDLE_HOOK 1
|
||||||
#define configUSE_TICK_HOOK 0
|
#define configUSE_TICK_HOOK 0
|
||||||
#define configCPU_CLOCK_HZ ( 75000000UL )
|
#define configCPU_CLOCK_HZ ( SystemFrequency )
|
||||||
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
|
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
|
||||||
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
|
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
|
||||||
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 90 )
|
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 90 )
|
||||||
|
@ -108,7 +115,7 @@
|
||||||
|
|
||||||
/* Software timer definitions. */
|
/* Software timer definitions. */
|
||||||
#define configUSE_TIMERS 1
|
#define configUSE_TIMERS 1
|
||||||
#define configTIMER_TASK_PRIORITY ( 3 )
|
#define configTIMER_TASK_PRIORITY ( 2 )
|
||||||
#define configTIMER_QUEUE_LENGTH 10
|
#define configTIMER_QUEUE_LENGTH 10
|
||||||
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )
|
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )
|
||||||
|
|
||||||
|
|
|
@ -327,6 +327,12 @@ int main(void)
|
||||||
/* Create the web server task. */
|
/* Create the web server task. */
|
||||||
xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainuIP_STACK_SIZE, NULL, mainuIP_TASK_PRIORITY, NULL );
|
xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainuIP_STACK_SIZE, NULL, mainuIP_TASK_PRIORITY, NULL );
|
||||||
|
|
||||||
|
/* The suicide tasks must be created last, as they need to know how many
|
||||||
|
tasks were running prior to their creation in order to ascertain whether
|
||||||
|
or not the correct/expected number of tasks are running at any given
|
||||||
|
time. */
|
||||||
|
vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );
|
||||||
|
|
||||||
/* Start the tasks and timer running. */
|
/* Start the tasks and timer running. */
|
||||||
vTaskStartScheduler();
|
vTaskStartScheduler();
|
||||||
}
|
}
|
||||||
|
@ -443,13 +449,6 @@ static void prvQueueSendTask( void *pvParameters )
|
||||||
portTickType xNextWakeTime;
|
portTickType xNextWakeTime;
|
||||||
const unsigned long ulValueToSend = 100UL;
|
const unsigned long ulValueToSend = 100UL;
|
||||||
|
|
||||||
/* The suicide tasks must be created last, as they need to know how many
|
|
||||||
tasks were running prior to their creation in order to ascertain whether
|
|
||||||
or not the correct/expected number of tasks are running at any given time.
|
|
||||||
Therefore the standard demo 'death' tasks are not created in main(), but
|
|
||||||
instead created here. */
|
|
||||||
vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );
|
|
||||||
|
|
||||||
/* The timer command queue will have been filled when the timer test tasks
|
/* The timer command queue will have been filled when the timer test tasks
|
||||||
were created in main() (this is part of the test they perform). Therefore,
|
were created in main() (this is part of the test they perform). Therefore,
|
||||||
while the check and OLED timers can be created in main(), they cannot be
|
while the check and OLED timers can be created in main(), they cannot be
|
||||||
|
@ -502,23 +501,9 @@ unsigned long ulReceivedValue;
|
||||||
|
|
||||||
static void vOLEDTimerCallback( xTimerHandle xHandle )
|
static void vOLEDTimerCallback( xTimerHandle xHandle )
|
||||||
{
|
{
|
||||||
volatile size_t xFreeStackSpace;
|
|
||||||
static struct oled_data xOLEDData;
|
static struct oled_data xOLEDData;
|
||||||
static unsigned char ucOffset1 = 0, ucOffset2 = 5;
|
static unsigned char ucOffset1 = 0, ucOffset2 = 5;
|
||||||
|
|
||||||
/* This function is called on each cycle of the idle task. In this case it
|
|
||||||
does nothing useful, other than report the amount of FreeRTOS heap that
|
|
||||||
remains unallocated. */
|
|
||||||
xFreeStackSpace = xPortGetFreeHeapSize();
|
|
||||||
|
|
||||||
if( xFreeStackSpace > 100 )
|
|
||||||
{
|
|
||||||
/* By now, the kernel has allocated everything it is going to, so
|
|
||||||
if there is a lot of heap remaining unallocated then
|
|
||||||
the value of configTOTAL_HEAP_SIZE in FreeRTOSConfig.h can be
|
|
||||||
reduced accordingly. */
|
|
||||||
}
|
|
||||||
|
|
||||||
xOLEDData.line1 = FIRST_LINE;
|
xOLEDData.line1 = FIRST_LINE;
|
||||||
xOLEDData.char_offset1 = ucOffset1++;
|
xOLEDData.char_offset1 = ucOffset1++;
|
||||||
xOLEDData.string1 = " www.FreeRTOS.org";
|
xOLEDData.string1 = " www.FreeRTOS.org";
|
||||||
|
@ -540,6 +525,8 @@ static unsigned char ucOffset1 = 0, ucOffset2 = 5;
|
||||||
|
|
||||||
static void prvSetupHardware( void )
|
static void prvSetupHardware( void )
|
||||||
{
|
{
|
||||||
|
SystemCoreClockUpdate();
|
||||||
|
|
||||||
/* Disable the Watch Dog Timer */
|
/* Disable the Watch Dog Timer */
|
||||||
MSS_WD_disable( );
|
MSS_WD_disable( );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue