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.h
- Revision:
- 35:b42afc973902
- Parent:
- 32:535acb159709
- Child:
- 36:8544a8900884
diff -r 9a4103f39042 -r b42afc973902 Steering.h --- a/Steering.h Sat Nov 15 19:10:34 2014 +0000 +++ b/Steering.h Sat Nov 22 22:24:53 2014 +0000 @@ -11,6 +11,8 @@ #include "Comic24.h" #include "vivaldi16.h" #include "CANBuffer.h" +#include "variables.h" + #include "LPCDigitalIn.h" @@ -31,6 +33,8 @@ #define BATTERY_AVG_CELLTEMPERATURE_ID 0x30B #define AMS_BATTERY_STATE 0x30E // AIRS 7 and 6 // Precharge 3 +#define NUM_SCREEN 2 + #define HOME_SCREEN 0 #define BATTERY_SCREEN 1 @@ -103,15 +107,49 @@ {102,32}, //tsm }; -int maxScreen=2; -int curr_screen; +int curr_screen; +int screen_flags[NUM_SCREEN]; +bool should_redraw; char drive_status; char drive_status_request; char reset_body; +node * id_node = NULL; +variables * vars_list; Mutex ds_mutex; +/* +void read_messages(void const *args) { + + while (true) { + CANMessage Rxmsg; + + if(CAN_Steering_Buffer.rxRead(Rxmsg)) + if(Rxmsg.id == PCM_STATE_ID){ + + // Mutex to protex shared variables + ds_mutex.lock(); + drive_status = Rxmsg.data[0]; + ds_mutex.unlock(); + } + + if(Rxmsg.id == BATTERY_POWER_ID) + { + float power_ratio; + ftc rcv; + rcv.FLOAT=0.0; + + for(int i=0; i<4; i++){ + rcv.C_FLOAT[i] = Rxmsg.data[i]; + } + power_ratio=rcv.FLOAT/80000; + ledstream.write(power_ratio); + } + } + } +*/ + #endif /* STEERING_H */ \ No newline at end of file