-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
80 lines (64 loc) · 2.26 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include "include/FreeRTOS.h"
#include "include/task.h"
#include "queue.h"
#include "inc\hw_types.h"
#include "inc\hw_memmap.h"
#include "drivers/rit128x96x4.h"
#include "hw_ints.h"
#include "driverlib/adc.h"
#include "driverlib/gpio.h"
#include "driverlib/interrupt.h"
#include "driverlib/sysctl.h"
#include "driverlib/timer.h"
#include "state.h"
#include "tasks/projectTasks.h"
#include "debug.h"
#include "semphr.h"
#include "calculationPacket.h"
#include "ADC.h"
#include "peripherals.h"
int main( void )
{
/* Set the clocking to run from the PLL at 50 MHz. Assumes 8MHz XTAL,
whereas some older eval boards used 6MHz. */
SysCtlClockSet( SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ );
initialiseDebugging();
initPeripherals();
initialiseState();
adcBufferIndex = 0;
xScreenQueue = xQueueCreate(10, sizeof (Calculation));
sampling = xSemaphoreCreateCounting(1, 0);;
screenQueueCount = xSemaphoreCreateCounting(10, 0);
xTaskCreate(screenDrawTask, "Task 1", 240 /*stack depth*/, (void*)NULL, 1, NULL );
xTaskCreate( processADCDataTask, "Task 3", 240, (void*)NULL, 10, NULL );
/* Start the scheduler so our tasks start executing. */
vTaskStartScheduler();
/* If all is well we will never reach here as the scheduler will now be
running. If we do reach here then it is likely that there was insufficient
heap available for the idle task to be created. */
for( ;; );
}
void vApplicationMallocFailedHook( void )
{
/* This function will only be called if an API call to create a task, queue
or semaphore fails because there is too little heap RAM remaining. */
for( ;; );
}
/*-----------------------------------------------------------*/
void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName )
{
/* This function will only be called if a task overflows its stack. Note
that stack overflow checking does slow down the context switch
implementation. */
for( ;; );
}
/*-----------------------------------------------------------*/
void vApplicationIdleHook( void )
{
/* This example does not use the idle hook to perform any processing. */
}
/*-----------------------------------------------------------*/
void vApplicationTickHook( void )
{
/* This example does not use the tick hook to perform any processing. */
}