gprs

Fork of Nucleo_printf_test by dong yanzhi

Files at this revision

API Documentation at this revision

Comitter:
donghuoyinzi
Date:
Wed Jun 21 03:28:46 2017 +0000
Parent:
0:3ba942901d6e
Commit message:
401FUSION

Changed in this revision

main.cpp Show diff for this revision Revisions of this file
mbed.bld Show diff for this revision Revisions of this file
mbed_config.h Show annotated file Show diff for this revision Revisions of this file
usart.c Show annotated file Show diff for this revision Revisions of this file
usart.h Show annotated file Show diff for this revision Revisions of this file
--- 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++;
-}
--- 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
--- 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
 
--- 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 ;
--- 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