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.
Dependents: 2-1_GMS6-CR6 5_flightmode 5-2_thrustermode 5-3_thruster_depressmode ... more
Diff: GMS6_CR6.cpp
- Revision:
- 4:dc48563aad90
- Parent:
- 3:b4133b354e5b
--- a/GMS6_CR6.cpp Fri Jul 17 12:13:26 2020 +0000 +++ b/GMS6_CR6.cpp Fri Jul 17 18:40:11 2020 +0000 @@ -75,7 +75,7 @@ } } -void GMS6_CR6::read_low(float *G) +void GMS6_CR6::read_solid(float *G) { char gps_data[256]; memset(gps_data, '\0', 256); @@ -88,9 +88,9 @@ float lon_east = 0; float lat_north = 0; - int i = 0; + unsigned int i = 0; - while(lat_north < 20 && i < 1000000) //緯度が20度以上と測定されるまたは一定回数ループが回ると抜ける + while(lat_north < 20 && i < 10000000) //緯度が20度以上と測定されるまたは一定回数ループが回ると抜ける { if(gps.readable()) { @@ -110,6 +110,10 @@ lat_north = _DMS2DEG(lat_north); lon_east = _DMS2DEG(lon_east); } + else + { + return; + } } } else @@ -124,6 +128,7 @@ { *G = lat_north; *(G+1) = lon_east; + return; } else {