Andrei Carp / Mbed 2 deprecated mbed_uart0_echo

Dependencies:   Queue mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "rtos.h"
00003 #include "ringbuf.h"
00004 #include "serial_bus.h"
00005 #include "can_bus.h"
00006 
00007 Serial pc(USBTX, USBRX);
00008 
00009 DigitalOut reset(p21);
00010 DigitalOut enable(p22);
00011 DigitalOut reflash(p23);
00012 
00013 void main() {
00014    
00015     pc.baud(115200);
00016     
00017     /* setup the system before using it */
00018     reset = 0;
00019     enable = 1;
00020     reflash = 1;
00021     
00022     wait(0.1);
00023     reset = 1;
00024     wait(2.0);
00025     pc.printf("mbed boot up... \r\n");
00026     
00027     start_serial_bus();
00028     
00029     while(1) 
00030     {
00031         Thread::wait(100);
00032         }
00033 }