The Code Repository for the REV0 Steering Wheel.
Dependencies: CANBuffer KS0108_fork mbed-rtos mbed CAN Addresses
Fork of REVO_Updated_Steering by
Diff: Steering.cpp
- Revision:
- 26:e0256fd314eb
- Parent:
- 25:fc63a5bffffc
- Child:
- 32:535acb159709
--- a/Steering.cpp Fri Nov 14 00:21:05 2014 +0000 +++ b/Steering.cpp Fri Nov 14 01:43:42 2014 +0000 @@ -2,6 +2,24 @@ bool NOT_biSWBL_HELD; +void display_screen(int screen){ + + switch(screen){ + + case HOME_SCREEN: + + display.ClearScreen(); + display.SelectFont(Arial12,BLACK,ReadData); + display.GotoXY(0,64); + display.PrintString("Chg Drv Stat"); + + default: + break; + + } + +} + void request_status_change(){ char drive_status_request; @@ -51,6 +69,7 @@ void Init() { pc.baud(921600); + curr_screen = HOME_SCREEN; drive_status = 0; drive_status_request = 1; reset_body = 0; @@ -99,12 +118,14 @@ display.PrintString("Penn Electric Racing"); CAN_Steering_Buffer.mode(NoAck); + wait(2); + //New thread to read messages. Thread update_thread(read_messages); - update_thread.set_priority(osPriorityLow); - - - wait(1); + + // display the screen. + display_screen(curr_screen); + // Start to read buttons on main thread while(1) @@ -122,7 +143,6 @@ // ignore BiSWBL.read() } - if(biSWBR.read()){ reset(); }