#ifndef FREERTOS_CONFIG_H\r
#define FREERTOS_CONFIG_H\r
\r
+#ifdef __ICCARM__\r
+ #include <stdint.h>\r
+ #include <stddef.h>\r
+ extern uint32_t SystemFrequency;\r
+#endif\r
+\r
/*-----------------------------------------------------------\r
* Application specific definitions.\r
*\r
* See http://www.freertos.org/a00110.html.\r
*----------------------------------------------------------*/\r
\r
+\r
#define configUSE_PREEMPTION 1\r
#define configUSE_IDLE_HOOK 1\r
#define configUSE_TICK_HOOK 0\r
-#define configCPU_CLOCK_HZ ( 75000000UL )\r
+#define configCPU_CLOCK_HZ ( SystemFrequency )\r
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )\r
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )\r
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 90 )\r
\r
/* Software timer definitions. */\r
#define configUSE_TIMERS 1\r
-#define configTIMER_TASK_PRIORITY ( 3 )\r
+#define configTIMER_TASK_PRIORITY ( 2 )\r
#define configTIMER_QUEUE_LENGTH 10\r
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )\r
\r
\r
/* Create the web server task. */\r
xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainuIP_STACK_SIZE, NULL, mainuIP_TASK_PRIORITY, NULL );\r
+ \r
+ /* The suicide tasks must be created last, as they need to know how many\r
+ tasks were running prior to their creation in order to ascertain whether\r
+ or not the correct/expected number of tasks are running at any given\r
+ time. */\r
+ vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
\r
/* Start the tasks and timer running. */\r
vTaskStartScheduler();\r
portTickType xNextWakeTime;\r
const unsigned long ulValueToSend = 100UL;\r
\r
- /* The suicide tasks must be created last, as they need to know how many\r
- tasks were running prior to their creation in order to ascertain whether\r
- or not the correct/expected number of tasks are running at any given time.\r
- Therefore the standard demo 'death' tasks are not created in main(), but\r
- instead created here. */\r
- vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
-\r
/* The timer command queue will have been filled when the timer test tasks\r
were created in main() (this is part of the test they perform). Therefore,\r
while the check and OLED timers can be created in main(), they cannot be\r
\r
static void vOLEDTimerCallback( xTimerHandle xHandle )\r
{\r
-volatile size_t xFreeStackSpace;\r
static struct oled_data xOLEDData;\r
static unsigned char ucOffset1 = 0, ucOffset2 = 5;\r
\r
- /* This function is called on each cycle of the idle task. In this case it\r
- does nothing useful, other than report the amount of FreeRTOS heap that\r
- remains unallocated. */\r
- xFreeStackSpace = xPortGetFreeHeapSize();\r
-\r
- if( xFreeStackSpace > 100 )\r
- {\r
- /* By now, the kernel has allocated everything it is going to, so\r
- if there is a lot of heap remaining unallocated then\r
- the value of configTOTAL_HEAP_SIZE in FreeRTOSConfig.h can be\r
- reduced accordingly. */\r
- }\r
-\r
xOLEDData.line1 = FIRST_LINE;\r
xOLEDData.char_offset1 = ucOffset1++;\r
- xOLEDData.string1 = "www.FreeRTOS.org";\r
+ xOLEDData.string1 = " www.FreeRTOS.org";\r
\r
xOLEDData.line2 = SECOND_LINE;\r
xOLEDData.char_offset2 = ucOffset2++;\r
- xOLEDData.string2 = "www.FreeRTOS.org";\r
+ xOLEDData.string2 = " www.FreeRTOS.org";\r
\r
xOLEDData.contrast_val = OLED_CONTRAST_VAL;\r
xOLEDData.on_off = OLED_HORIZ_SCROLL_OFF;\r
\r
static void prvSetupHardware( void )\r
{\r
+ SystemCoreClockUpdate();\r
+ \r
/* Disable the Watch Dog Timer */\r
MSS_WD_disable( );\r
\r