gprs
Fork of Nucleo_printf_test by
Revision 1:78ed2d2c5af7, committed 2017-06-21
- Comitter:
- donghuoyinzi
- Date:
- Wed Jun 21 03:28:46 2017 +0000
- Parent:
- 0:3ba942901d6e
- Commit message:
- 401FUSION
Changed in this revision
diff -r 3ba942901d6e -r 78ed2d2c5af7 main.cpp --- a/main.cpp Fri Jun 09 02:45:45 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -#include "mbed.h" -#include <cstring> - -Serial pc(SERIAL_TX, SERIAL_RX); //USART2 -Serial gps(D1,D0); //USART1 -DigitalOut myled(LED1); -char buffer[256]; -void getline(); -void callback() -{ - getline(); -} -volatile int sig=0; -volatile int i=0; -int main() -{ - pc.printf("start test!\r\n"); - gps.attach(&callback); - - while(1) - { - hal_sleep(); - if(sig == 7) - { - sig=0; - i=0; - pc.printf("%s",buffer); - memset(buffer,0,sizeof(buffer)); - } - } -} - - -void getline() -{ - buffer[i] = gps.getc(); - if(buffer[i] == 0x0a) - { - sig++; - } - i++; -}
diff -r 3ba942901d6e -r 78ed2d2c5af7 mbed.bld --- a/mbed.bld Fri Jun 09 02:45:45 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -https://mbed.org/users/mbed_official/code/mbed/builds/86740a56073b \ No newline at end of file
diff -r 3ba942901d6e -r 78ed2d2c5af7 mbed_config.h --- a/mbed_config.h Fri Jun 09 02:45:45 2017 +0000 +++ b/mbed_config.h Wed Jun 21 03:28:46 2017 +0000 @@ -5,8 +5,8 @@ #define __MBED_CONFIG_DATA__ // Configuration parameters -#define MBED_CONF_PLATFORM_STDIO_BAUD_RATE 9600 // set by library:platform -#define MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE 9600 // set by library:platform +#define MBED_CONF_PLATFORM_STDIO_BAUD_RATE 115200 // set by library:platform +#define MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE 115200 // set by library:platform #define MBED_CONF_PLATFORM_STDIO_FLUSH_AT_EXIT 1 // set by library:platform #define MBED_CONF_PLATFORM_STDIO_CONVERT_NEWLINES 0 // set by library:platform
diff -r 3ba942901d6e -r 78ed2d2c5af7 usart.c --- a/usart.c Fri Jun 09 02:45:45 2017 +0000 +++ b/usart.c Wed Jun 21 03:28:46 2017 +0000 @@ -17,7 +17,7 @@ UsartHandleStruct.Init = UsartInitStruct; UsartHandleStruct.Instance = USART2; UsartHandleStruct.Lock = HAL_LOCKED; - UsartHandleStruct.pRxBuffPtr =NULL ; + UsartHandleStruct.pRxBuffPtr ="NULL" ; UsartHandleStruct.pTxBuffPtr =NULL; UsartHandleStruct.RxXferCount =NULL ; UsartHandleStruct.RxXferSize =NULL ;
diff -r 3ba942901d6e -r 78ed2d2c5af7 usart.h --- a/usart.h Fri Jun 09 02:45:45 2017 +0000 +++ b/usart.h Wed Jun 21 03:28:46 2017 +0000 @@ -1,7 +1,7 @@ #ifndef __USART_H #define __USART_H -#include "stm32l4xx.h" - +//#include "stm32l4xx.h" +#include "stm32f4xx.h" #endif \ No newline at end of file