![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
All tasks complete
Dependencies: mbed MCP23017 mbed-rtos WattBob_TextLCD
main.cpp@9:2fd97246b8f0, 2019-03-27 (annotated)
- Committer:
- aingks
- Date:
- Wed Mar 27 12:28:10 2019 +0000
- Revision:
- 9:2fd97246b8f0
- Parent:
- 8:3f3f2c2e2046
- Child:
- 10:2b262d810c67
added indicator check module, not compiling ;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
aingks | 0:0943f040009c | 1 | #include "header.h" |
aingks | 1:c4f62ef9b5b7 | 2 | /* |
aingks | 1:c4f62ef9b5b7 | 3 | Embedded Software: Assignment 3 |
aingks | 1:c4f62ef9b5b7 | 4 | |
aingks | 1:c4f62ef9b5b7 | 5 | Description: |
aingks | 1:c4f62ef9b5b7 | 6 | |
aingks | 1:c4f62ef9b5b7 | 7 | |
aingks | 0:0943f040009c | 8 | |
aingks | 0:0943f040009c | 9 | |
aingks | 3:f88d667629e6 | 10 | Version 0.2 Aingkaran Suppiah |
aingks | 1:c4f62ef9b5b7 | 11 | */ |
aingks | 1:c4f62ef9b5b7 | 12 | |
aingks | 4:27340b291c09 | 13 | SDATA speed = SDATA(); |
aingks | 4:27340b291c09 | 14 | CARINFO info = CARINFO(); |
aingks | 4:27340b291c09 | 15 | SIMU_DATA sim = SIMU_DATA(); |
aingks | 4:27340b291c09 | 16 | |
aingks | 4:27340b291c09 | 17 | |
aingks | 4:27340b291c09 | 18 | |
aingks | 8:3f3f2c2e2046 | 19 | MCP23017 *par_port; // pointer to 16-bit parallel I/O object **was = NULL |
aingks | 8:3f3f2c2e2046 | 20 | WattBob_TextLCD *display; // pointer to 2*16 chacater LCD object **was = NULL |
aingks | 4:27340b291c09 | 21 | |
aingks | 4:27340b291c09 | 22 | |
aingks | 4:27340b291c09 | 23 | |
aingks | 4:27340b291c09 | 24 | Mutex simuXS; |
aingks | 4:27340b291c09 | 25 | Mutex speedXS; |
aingks | 4:27340b291c09 | 26 | Mutex carstateXS; |
aingks | 0:0943f040009c | 27 | |
aingks | 8:3f3f2c2e2046 | 28 | int main() { |
aingks | 8:3f3f2c2e2046 | 29 | |
aingks | 8:3f3f2c2e2046 | 30 | |
aingks | 8:3f3f2c2e2046 | 31 | par_port = new MCP23017(p9, p10, 0x40); // initialise 16-bit I/O chip |
aingks | 8:3f3f2c2e2046 | 32 | |
aingks | 8:3f3f2c2e2046 | 33 | display = new WattBob_TextLCD(par_port); // initialise 2*26 char display |
aingks | 8:3f3f2c2e2046 | 34 | |
aingks | 8:3f3f2c2e2046 | 35 | par_port->write_bit(1,BL_BIT); // turn LCD backlight ON |
aingks | 8:3f3f2c2e2046 | 36 | |
aingks | 8:3f3f2c2e2046 | 37 | |
aingks | 8:3f3f2c2e2046 | 38 | Thread thread_1(task1readbrake); |
aingks | 8:3f3f2c2e2046 | 39 | Thread thread_2(task2readaccel); |
aingks | 8:3f3f2c2e2046 | 40 | Thread thread_3(task3enginestate); |
aingks | 8:3f3f2c2e2046 | 41 | Thread thread_4(task4average); |
aingks | 8:3f3f2c2e2046 | 42 | Thread thread_5(task5brakeLED); |
aingks | 8:3f3f2c2e2046 | 43 | Thread thread_6(task6speedmonitor); |
aingks | 8:3f3f2c2e2046 | 44 | Thread thread_7(task7displayvalues); |
aingks | 8:3f3f2c2e2046 | 45 | Thread thread_8(task8sidelights); |
aingks | 9:2fd97246b8f0 | 46 | Thread thread_9(task9indLED(); |
aingks | 8:3f3f2c2e2046 | 47 | //Thread thread_10(taskXserialdump); |
aingks | 8:3f3f2c2e2046 | 48 | |
aingks | 8:3f3f2c2e2046 | 49 | |
aingks | 3:f88d667629e6 | 50 | |
aingks | 3:f88d667629e6 | 51 | // set up for the LCD |
aingks | 4:27340b291c09 | 52 | |
aingks | 8:3f3f2c2e2046 | 53 | |
aingks | 0:0943f040009c | 54 | |
aingks | 8:3f3f2c2e2046 | 55 | while(1){ |
aingks | 8:3f3f2c2e2046 | 56 | |
aingks | 8:3f3f2c2e2046 | 57 | } |
aingks | 0:0943f040009c | 58 | } |