Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Servo mbed-rtos mbed
main.cpp
- Committer:
- mariob
- Date:
- 2015-10-08
- Revision:
- 2:7dfc8dd6aab3
- Parent:
- 1:79b1ee0f97ef
- Child:
- 3:bfc20ec72b15
File content as of revision 2:7dfc8dd6aab3:
#include "mbed.h" #include "car_config.hpp" #include "rtos.h" #include "can.hpp" #include "led.hpp" #include "body.hpp" #include "engine.hpp" #include "driver.hpp" #include "clock.hpp" //initialize the system: //- single components: body, clock, driver (diagnosis), engine //- hardware: leds, can //- threads int init(); int main() { //system setup init(); //main loop while(1) {}; } Thread *th_body; Thread *th_can; 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); } int init () { init_body(); init_clock(); init_driver(); init_engine(); //printf("INIT LED\r\n"); init_led(); //printf("INIT CAN\r\n"); init_can(); //printf("INIT THREAD\r\n"); init_threads(); return true; }