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.
uart2.cpp
00001 00002 #include "mbed.h" 00003 #include "uart2.h" 00004 00005 extern Serial device2; 00006 extern BusOut mbedleds; 00007 00008 extern uint8_t data[4]; 00009 00010 uint8_t data2[5]; 00011 00012 00013 void dev2_rx() 00014 { 00015 static uint8_t count3 = 0; 00016 static uint8_t RecData2[RECEIVE2_DATA_NUM]; 00017 00018 RecData2[count3] = device2.getc(); 00019 00020 00021 00022 if(RecData2[KEY3] == KEYCODE4){ 00023 count3++; 00024 00025 }else{ 00026 count3 = 0; 00027 } 00028 if(count3 >= RECEIVE2_DATA_NUM){ 00029 if(RecData2[CHECK3] == CHECKCODE4){ 00030 //mbedleds = 8; 00031 mbedleds = 15; 00032 data2[0] = RecData2[DATA31]; 00033 data2[1] = RecData2[DATA32]; 00034 data2[2] = RecData2[DATA33]; 00035 data2[3] = RecData2[DATA34]; 00036 data2[4] = RecData2[DATA35]; 00037 } 00038 count3 = 0; 00039 } 00040 } 00041 00042 void dev2_tx() 00043 { 00044 static uint8_t count4 = 0; 00045 static uint8_t SendData2[SEND2_DATA_NUM]; 00046 00047 if(count4 >= SEND2_DATA_NUM){ 00048 SendData2[KEY4] = KEYCODE3; 00049 SendData2[DATA41] = 33; 00050 SendData2[DATA42] = data[2]; 00051 SendData2[DATA43] = 52; 00052 SendData2[DATA44] = 33; 00053 SendData2[DATA45] = 38; 00054 SendData2[CHECK4] = CHECKCODE3; 00055 00056 count4 = 0; 00057 00058 } 00059 device2.putc(SendData2[count4]); 00060 00061 count4++; 00062 }
Generated on Tue Jul 12 2022 12:46:47 by
1.7.2