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 if(RecData2[KEY3] == KEYCODE4){ 00021 count3++; 00022 }else{ 00023 count3 = 0; 00024 } 00025 if(count3 >= RECEIVE2_DATA_NUM){ 00026 if(RecData2[CHECK3] == CHECKCODE4){ 00027 mbedleds = 15; 00028 data2[0] = RecData2[DATA31]; 00029 data2[1] = RecData2[DATA32]; 00030 data2[2] = RecData2[DATA33]; 00031 data2[3] = RecData2[DATA34]; 00032 data2[4] = RecData2[DATA35]; 00033 } 00034 count3 = 0; 00035 } 00036 } 00037 00038 void dev2_tx() 00039 { 00040 static uint8_t count4 = 0; 00041 static uint8_t SendData2[SEND2_DATA_NUM]; 00042 00043 if(count4 >= SEND2_DATA_NUM){ 00044 SendData2[KEY4] = KEYCODE3; 00045 SendData2[DATA41] = 33; 00046 SendData2[DATA42] = data[2]; 00047 SendData2[DATA43] = 52; 00048 SendData2[DATA44] = 33; 00049 SendData2[DATA45] = 38; 00050 SendData2[CHECK4] = CHECKCODE3; 00051 00052 count4 = 0; 00053 } 00054 device2.putc(SendData2[count4]); 00055 00056 count4++; 00057 }
Generated on Wed Jul 20 2022 05:51:04 by
1.7.2