Mario Bambagini / Mbed 2 deprecated car_chassis

Dependencies:   Servo mbed-rtos mbed

Revision:
1:79b1ee0f97ef
Parent:
0:ce6055872f4e
Child:
2:7dfc8dd6aab3
--- a/main.cpp	Sun Aug 02 12:55:33 2015 +0000
+++ b/main.cpp	Mon Aug 31 22:25:57 2015 +0000
@@ -2,6 +2,12 @@
 #include "car_config.hpp"
 #include "rtos.h"
 
+#include "led.hpp"
+#include "body.hpp"
+#include "engine.hpp"
+#include "driver.hpp"
+#include "clock.hpp"
+
 int init();
 
 int main()
@@ -11,48 +17,50 @@
     while(1) {};
 }
 
-void init_led();
 void init_eeprom();
 
 Thread *th_body;
 Thread *th_can;
-
-void thread_body(void const *args);
-void thread_can(void const *args);
+Thread *th_engine;
+Thread *th_driver;
+Thread *th_clock;
 
 void init_threads ()
 {
     th_body = new Thread(thread_body);
+    th_engine = new Thread(thread_engine);
     th_can = new Thread(thread_can);
+    th_driver = new Thread(thread_driver);
+    th_clock = new Thread(thread_clock);
 }
-void init_body();
 
 int init ()
 {
+    init_body();
+    init_clock();
+    init_driver();
+    init_engine();
 
-    init_body();
-    
     printf("INIT LED\r\n");
     init_led();
-    
+
+/*
     printf("INIT EEPROM\r\n");
-//    init_eeprom();
+    init_eeprom();
+*/
 
     printf("INIT CAN\r\n");
     init_can();
 
-    
     printf("INIT THREAD\r\n");
     init_threads();
 
-
-
     return true;
 }
 
 
 /****************** EEPROM ******************/
-
+/*
 eeprom_t eeprom(p7, p5, p6, p9, PAGENUMBER, PAGESIZE);
 
 t_eeprom_data eeprom_data[] = {
@@ -61,8 +69,6 @@
     {    2,      2}, //DATA VERSION
     {    4,      4}, //NUMBER OF STARTS
     {    4,     20}, //T_MISSING
-    {    2,     22}, //MIN PWM ON
-    {    2,     24}, //MAX PWM ON
     {    4,     40}, //ENGINE_LAST_MISSING
     {    4,     44}  //BODY_LAST_MISSING
 };
@@ -91,3 +97,4 @@
     num++;
     eeprom.write(EEPROM_DATA_NSTARTS, (unsigned char*)(&num));
 }
+*/