-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
91 lines (68 loc) · 2.5 KB
/
main.c
File metadata and controls
91 lines (68 loc) · 2.5 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/// ///
/// APS de Sistemas Embarcados ///
/// Embedded Systems Final Project ///
/// ///
/// Bruno Follmann ///
/// Willian Americano Lopes ///
/// ///
/// Prof. Dr. Gustavo Weber Denardin ///
/// Driver design based on Almeida's model ///
/// ///
///////////////////////////////////////////////////////////////////////////////////////
// Standard includes.
#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
// MCU includes
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_ints.h"
#include "driverlib/gpio.h"
#include "driverlib/pin_map.h"
#include "driverlib/rom.h"
#include "driverlib/rom_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/debug.h"
// Kernel includes.
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "semphr.h"
#include "TarefaTeste.h"
static xTaskHandle tsk1; // Task1
static xTaskHandle tsk2; // Task2
//static xTaskHandle tsk2; // Task2
// Variable to get the
extern uint32_t g_ui32SysClock;
void CPUconfig(void)
{
// Set the clocking to run directly from the crystal at 120MHz.
g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
SYSCTL_OSC_MAIN |
SYSCTL_USE_PLL |
SYSCTL_CFG_VCO_480), 120000000);
// Enable the GPIO port that is used for the on-board LED.
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION);
// Enable the GPIO pins for the LED (PN0).
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_0);
// Enable Interrupts from the CPU
ROM_IntMasterEnable();
}
void main(void)
{
CPUconfig(); // Function to configure the CPU
//BaseType_t xTaskCreate( TaskFunction_t pvTaskCode,
// const char * const pcName,
// unsigned short usStackDepth,
// void *pvParameters,
// UBaseType_t uxPriority,
// TaskHandle_t *pxCreatedTask
// );
initController(); // Initialize the driver controller
// Install the tasks
xTaskCreate(TestTask1,"Tarefa1",256,NULL,1,&tsk1);
xTaskCreate(TestTask2,"Tarefa2",256,NULL,2,&tsk2);
vTaskStartScheduler(); // Start the scheduler
//while(1);
}
///////////////////////////////////////////////////////////////////////////////////////