Penn Electric Racing / Mbed 2 deprecated REVO_Updated_Steering

Dependencies:   CANBuffer KS0108_fork mbed-rtos mbed CAN Addresses

Fork of REVO_Updated_Steering by Penn Electric

Files at this revision

API Documentation at this revision

Comitter:
palimar
Date:
Fri Nov 14 01:43:42 2014 +0000
Parent:
25:fc63a5bffffc
Child:
32:535acb159709
Commit message:
rudimentary display methods added

Changed in this revision

Steering.cpp Show annotated file Show diff for this revision Revisions of this file
Steering.h Show annotated file Show diff for this revision Revisions of this file
--- 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();
         }
--- a/Steering.h	Fri Nov 14 00:21:05 2014 +0000
+++ b/Steering.h	Fri Nov 14 01:43:42 2014 +0000
@@ -30,6 +30,8 @@
 #define BATTERY_AVG_CELLTEMPERATURE_ID 0x30B
 #define AMS_BATTERY_STATE 0x30E          // AIRS 7 and 6 // Precharge 3
 
+#define HOME_SCREEN 0
+
 Serial pc(USBTX,USBRX);
 CANBuffer CAN_Steering_Buffer(CAN1, MEDIUM, p3_26);
 
@@ -100,7 +102,7 @@
     };
     
 int maxScreen=5;
-int screen; 
+int curr_screen; 
 
 char drive_status;
 char drive_status_request;