![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
app4
Dependencies: mbed-rtos mbed CRC16
Fork of S5info_APP2 by
Diff: main.cpp
- Revision:
- 22:7244c3391bac
- Parent:
- 20:ac8682cf923b
- Child:
- 23:9c4e4898b741
diff -r ac8682cf923b -r 7244c3391bac main.cpp --- a/main.cpp Tue Mar 07 05:39:28 2017 +0000 +++ b/main.cpp Tue Mar 07 05:45:26 2017 +0000 @@ -48,7 +48,7 @@ { if ((LPC_TIM1->IR & 0x01) == 0x01) { - bTimer1 = !bTimer1; + send_data(); LPC_TIM1->IR |= 1 << 0; // clear } @@ -135,6 +135,16 @@ trame_length = taille + 7; //Longueur de la trame } +void write() +{ + byte_sent_pos = 0; + bit_sent = 7; + bTimer1 = false; + //TODO start interrupt timer 1 + //LPC_RIT->MCR = 1; //Permettre les interruption du MAT + //LPC_RIT->MR0 = LPC_RIT->TC + HALF_PERIOD; //Faire une interruption a la prochaine demi-periode +} + //obtention du texte void get_text() { @@ -150,16 +160,7 @@ } create_trame(text,count); -} - -void write() -{ - byte_sent_pos = 0; - bit_sent = 7; - bTimer1 = false; - //TODO start interrupt timer 1 - //LPC_RIT->MCR = 1; //Permettre les interruption du MAT - //LPC_RIT->MR0 = LPC_RIT->TC + HALF_PERIOD; //Faire une interruption a la prochaine demi-periode + write(); } void read() @@ -231,6 +232,8 @@ initTimers(); ThreadLecture.start(read); - while(true) { + while(true) + { + get_text(); } }; \ No newline at end of file