All tasks complete

Dependencies:   mbed MCP23017 mbed-rtos WattBob_TextLCD

Committer:
aingks
Date:
Tue Mar 26 15:20:57 2019 +0000
Revision:
5:f5dda79b93cb
Parent:
4:27340b291c09
Child:
6:abbd51d9b045
added frequency times (accommodating for the stage 9 case at 2 hz)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
aingks 0:0943f040009c 1 #ifndef HEADER_whatever
aingks 0:0943f040009c 2 #define HEADER_whatever
aingks 0:0943f040009c 3
aingks 0:0943f040009c 4 #include "mbed.h"
aingks 3:f88d667629e6 5 #include "WattBob_TextLCD.h"
aingks 3:f88d667629e6 6 #include "rtos.h"
aingks 4:27340b291c09 7 #include "MCP23017.h"
aingks 0:0943f040009c 8
aingks 0:0943f040009c 9 #define pin_analog_1 p15
aingks 0:0943f040009c 10 #define pin_analog_2 p16
aingks 0:0943f040009c 11
aingks 0:0943f040009c 12 #define pin_digital_1 p17
aingks 0:0943f040009c 13 #define pin_digital_2 p18
aingks 0:0943f040009c 14 #define pin_digital_3 p19
aingks 0:0943f040009c 15 #define pin_digital_4 p20
aingks 0:0943f040009c 16
aingks 0:0943f040009c 17 #define pin_LED1 LED1
aingks 0:0943f040009c 18 #define pin_LED2 LED2
aingks 0:0943f040009c 19 #define pin_LED3 LED3
aingks 0:0943f040009c 20 #define pin_LED4 LED4
aingks 0:0943f040009c 21 #define pin_LED5 p25
aingks 0:0943f040009c 22 #define pin_LED6 p26
aingks 0:0943f040009c 23
aingks 0:0943f040009c 24
aingks 5:f5dda79b93cb 25 #define MAXSPEED 160
aingks 5:f5dda79b93cb 26 #define SAMPLESIZE 5
aingks 5:f5dda79b93cb 27
aingks 5:f5dda79b93cb 28 //FREQUENCIES
aingks 5:f5dda79b93cb 29 #define CLOCKFREQ 20
aingks 5:f5dda79b93cb 30 #define TASK1FREQ 8
aingks 5:f5dda79b93cb 31 #define TASK2FREQ 10
aingks 5:f5dda79b93cb 32 #define TASK3FREQ 4
aingks 5:f5dda79b93cb 33 #define TASK4FREQ 4
aingks 5:f5dda79b93cb 34 #define TASK5FREQ 4
aingks 5:f5dda79b93cb 35 #define TASK6FREQ 5
aingks 5:f5dda79b93cb 36 #define TASK7FREQ 2
aingks 5:f5dda79b93cb 37 #define TASK8FREQ 4
aingks 5:f5dda79b93cb 38 #define TASK9FREQ 1
aingks 5:f5dda79b93cb 39 #define TASK9FREQS2 2
aingks 5:f5dda79b93cb 40 #define TASKXFREQ 0.5
aingks 5:f5dda79b93cb 41
aingks 5:f5dda79b93cb 42
aingks 0:0943f040009c 43
aingks 0:0943f040009c 44
aingks 0:0943f040009c 45 //call the functions at the end for the main
aingks 0:0943f040009c 46
aingks 0:0943f040009c 47
aingks 0:0943f040009c 48 //STRUCTURE
aingks 0:0943f040009c 49 typedef struct
aingks 0:0943f040009c 50 {
aingks 0:0943f040009c 51 float brakevalue;
aingks 1:c4f62ef9b5b7 52 float accelvalue;
aingks 0:0943f040009c 53 float array[5];
aingks 0:0943f040009c 54 float average;
aingks 0:0943f040009c 55 float rawspeed;
aingks 0:0943f040009c 56 }SDATA;
aingks 0:0943f040009c 57
aingks 0:0943f040009c 58
aingks 0:0943f040009c 59
aingks 4:27340b291c09 60
aingks 0:0943f040009c 61
aingks 2:9d6d07c9cc9c 62
aingks 0:0943f040009c 63 typedef struct
aingks 0:0943f040009c 64 {
aingks 2:9d6d07c9cc9c 65 int ENGINESTATE;
aingks 2:9d6d07c9cc9c 66 uint8_t odometer;
aingks 4:27340b291c09 67 uint8_t leftind;
aingks 4:27340b291c09 68 uint8_t rightind;
aingks 4:27340b291c09 69 uint8_t sideind;
aingks 4:27340b291c09 70 }CARINFO;
aingks 1:c4f62ef9b5b7 71
aingks 4:27340b291c09 72
aingks 0:0943f040009c 73
aingks 4:27340b291c09 74 typedef struct
aingks 4:27340b291c09 75 {
aingks 4:27340b291c09 76 float brakevalue;
aingks 4:27340b291c09 77 float accelvalue;
aingks 4:27340b291c09 78 float odometer;
aingks 4:27340b291c09 79 float rawspeed;
aingks 4:27340b291c09 80
aingks 4:27340b291c09 81 }SIMU_DATA;
aingks 3:f88d667629e6 82
aingks 4:27340b291c09 83
aingks 0:0943f040009c 84
aingks 0:0943f040009c 85
aingks 0:0943f040009c 86 //calling all functions
aingks 0:0943f040009c 87
aingks 0:0943f040009c 88 void task1readbrake();
aingks 0:0943f040009c 89 void task2readaccel();
aingks 0:0943f040009c 90 void task3enginestate();
aingks 0:0943f040009c 91 void task4average();
aingks 0:0943f040009c 92 void task5brakeLED();
aingks 0:0943f040009c 93 void task6speedmonitor();
aingks 0:0943f040009c 94 void task7displayvalues();
aingks 0:0943f040009c 95 void task8sidelights();
aingks 0:0943f040009c 96 void task9indLED();
aingks 0:0943f040009c 97 void taskXserialdump();
aingks 0:0943f040009c 98
aingks 0:0943f040009c 99
aingks 0:0943f040009c 100 #endif