generated from Template/H563ZI-HAL-CMake-Template
	Compare commits
	
		
			2 Commits
		
	
	
		
			4d36d07b2c
			...
			a6ebf4b8a5
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| a6ebf4b8a5 | |||
| 69d790d5e2 | 
| @@ -89,7 +89,11 @@ TX_QUEUE im948_uart_rx_queue; | |||||||
|  |  | ||||||
| /* Private function prototypes -----------------------------------------------*/ | /* Private function prototypes -----------------------------------------------*/ | ||||||
| /* USER CODE BEGIN PFP */ | /* USER CODE BEGIN PFP */ | ||||||
|  | #define GPS_TASK_STACK_SIZE   2048 | ||||||
|  | #define GPS_TASK_PRIORITY     11 | ||||||
|  |  | ||||||
|  | TX_THREAD gps_task; | ||||||
|  | ULONG gps_task_stack[GPS_TASK_STACK_SIZE / sizeof(ULONG)]; | ||||||
|  |  | ||||||
| /* USER CODE END 1 */ | /* USER CODE END 1 */ | ||||||
| /* USER CODE END 1 */ | /* USER CODE END 1 */ | ||||||
| @@ -158,8 +162,26 @@ UINT App_ThreadX_Init(VOID *memory_ptr) | |||||||
|                                TX_1_ULONG, // sizeof(ULONG) bytes per entry |                                TX_1_ULONG, // sizeof(ULONG) bytes per entry | ||||||
|                                im948_rx_queue_buffer, |                                im948_rx_queue_buffer, | ||||||
|                                IM948_RX_QUEUE_SIZE * sizeof(ULONG)); |                                IM948_RX_QUEUE_SIZE * sizeof(ULONG)); | ||||||
|  | 	if(status != TX_SUCCESS) | ||||||
|  | 	{ | ||||||
|  | 		return status; | ||||||
|  | 	} | ||||||
| 	 | 	 | ||||||
|  | 	status = tx_thread_create(&gps_task, | ||||||
|  |                   "GPS Task", | ||||||
|  |                   gps_thread_entry, | ||||||
|  |                   0, | ||||||
|  |                   gps_task_stack, | ||||||
|  |                   GPS_TASK_STACK_SIZE, | ||||||
|  |                   GPS_TASK_PRIORITY, | ||||||
|  |                   GPS_TASK_PRIORITY, | ||||||
|  |                   TX_NO_TIME_SLICE, | ||||||
|  |                   TX_AUTO_START); | ||||||
| 	 | 	 | ||||||
|  | 	if(status != TX_SUCCESS) | ||||||
|  | 	{ | ||||||
|  | 		return status; | ||||||
|  | 	} | ||||||
|     HCBle_SendData("✅ BLE RX/TX 线程和队列初始化完成\r\n"); |     HCBle_SendData("✅ BLE RX/TX 线程和队列初始化完成\r\n"); | ||||||
| 	 | 	 | ||||||
|     return TX_SUCCESS; |     return TX_SUCCESS; | ||||||
|   | |||||||
| @@ -103,6 +103,7 @@ int main(void) | |||||||
|   /* USER CODE BEGIN 2 */ |   /* USER CODE BEGIN 2 */ | ||||||
|  |  | ||||||
|    imu600_init(); |    imu600_init(); | ||||||
|  |    GPS_Init(); | ||||||
| //	HCBle_InitDMAReception(); | //	HCBle_InitDMAReception(); | ||||||
| //	HAL_Delay(200); | //	HAL_Delay(200); | ||||||
| //	GPS_Init(); | //	GPS_Init(); | ||||||
|   | |||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -225,6 +225,11 @@ | |||||||
|           <WinNumber>1</WinNumber> |           <WinNumber>1</WinNumber> | ||||||
|           <ItemText>isNewData</ItemText> |           <ItemText>isNewData</ItemText> | ||||||
|         </Ww> |         </Ww> | ||||||
|  |         <Ww> | ||||||
|  |           <count>15</count> | ||||||
|  |           <WinNumber>1</WinNumber> | ||||||
|  |           <ItemText>current_location</ItemText> | ||||||
|  |         </Ww> | ||||||
|       </WatchWindow1> |       </WatchWindow1> | ||||||
|       <WatchWindow2> |       <WatchWindow2> | ||||||
|         <Ww> |         <Ww> | ||||||
| @@ -252,6 +257,16 @@ | |||||||
|           <WinNumber>2</WinNumber> |           <WinNumber>2</WinNumber> | ||||||
|           <ItemText>AngleZ</ItemText> |           <ItemText>AngleZ</ItemText> | ||||||
|         </Ww> |         </Ww> | ||||||
|  |         <Ww> | ||||||
|  |           <count>5</count> | ||||||
|  |           <WinNumber>2</WinNumber> | ||||||
|  |           <ItemText>GPS_DMA_RX_BUF[GPS_DMA_RX_BUF_LEN]</ItemText> | ||||||
|  |         </Ww> | ||||||
|  |         <Ww> | ||||||
|  |           <count>6</count> | ||||||
|  |           <WinNumber>2</WinNumber> | ||||||
|  |           <ItemText>msg</ItemText> | ||||||
|  |         </Ww> | ||||||
|       </WatchWindow2> |       </WatchWindow2> | ||||||
|       <Tracepoint> |       <Tracepoint> | ||||||
|         <THDelay>0</THDelay> |         <THDelay>0</THDelay> | ||||||
|   | |||||||
										
											Binary file not shown.
										
									
								
							| @@ -28,10 +28,15 @@ Project File Date:  07/01/2025 | |||||||
| *** Using Compiler 'V6.21', folder: 'D:\keil5\ARM\ARMCLANG\Bin' | *** Using Compiler 'V6.21', folder: 'D:\keil5\ARM\ARMCLANG\Bin' | ||||||
| Build target 'AutoGuideStick' | Build target 'AutoGuideStick' | ||||||
| compiling imu948.c... | compiling imu948.c... | ||||||
|  | ../fun/HCBle.c(138): warning: illegal character encoding in string literal [-Winvalid-source-encoding] | ||||||
|  |   138 |     HCBle_SendData("? <BD><E2><CE><F6>ʧ<B0><DC>: %s\r\n", frame); | ||||||
|  |       |                       ^~~~~~~~~~~~~~~~ ~~~~~~~~ | ||||||
|  | 1 warning generated. | ||||||
|  | compiling HCBle.c... | ||||||
| linking... | linking... | ||||||
| Program Size: Code=82196 RO-data=1164 RW-data=20 ZI-data=12836   | Program Size: Code=83396 RO-data=1364 RW-data=20 ZI-data=15268   | ||||||
| FromELF: creating hex file... | FromELF: creating hex file... | ||||||
| "AutoGuideStick\AutoGuideStick.axf" - 0 Error(s), 0 Warning(s). | "AutoGuideStick\AutoGuideStick.axf" - 0 Error(s), 1 Warning(s). | ||||||
|  |  | ||||||
| <h2>Software Packages used:</h2> | <h2>Software Packages used:</h2> | ||||||
|  |  | ||||||
| @@ -55,7 +60,7 @@ Package Vendor: Keil | |||||||
|  |  | ||||||
|    * Component: ARM::CMSIS:CORE@5.6.0 |    * Component: ARM::CMSIS:CORE@5.6.0 | ||||||
|       Include file:  CMSIS/Core/Include/tz_context.h |       Include file:  CMSIS/Core/Include/tz_context.h | ||||||
| Build Time Elapsed:  00:00:02 | Build Time Elapsed:  00:00:01 | ||||||
| </pre> | </pre> | ||||||
| </body> | </body> | ||||||
| </html> | </html> | ||||||
|   | |||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -1,7 +1,7 @@ | |||||||
| Dependencies for Project 'AutoGuideStick', Target 'AutoGuideStick': (DO NOT MODIFY !) | Dependencies for Project 'AutoGuideStick', Target 'AutoGuideStick': (DO NOT MODIFY !) | ||||||
| CompilerVersion: 6210000::V6.21::ARMCLANG | CompilerVersion: 6210000::V6.21::ARMCLANG | ||||||
| F (startup_stm32h563xx.s)(0x68634847)(--target=arm-arm-none-eabi -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -masm=auto  -Wa,armasm,--diag_suppress=A1950W -c | F (startup_stm32h563xx.s)(0x68634847)(--target=arm-arm-none-eabi -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -masm=auto  -Wa,armasm,--diag_suppress=A1950W -c | ||||||
|  |  | ||||||
| -gdwarf-4 -Wa,armasm,--pd,"__MICROLIB SETA 1" -I ../Core/Inc -I ../AZURE_RTOS/App -I ../Drivers/STM32H5xx_HAL_Driver/Inc -I ../Drivers/STM32H5xx_HAL_Driver/Inc/Legacy -I ../Middlewares/ST/threadx/common/inc -I ../Drivers/CMSIS/Device/ST/STM32H5xx/Include -I ../Middlewares/ST/threadx/ports/cortex_m33/ac6/inc -I ../Drivers/CMSIS/Include | -gdwarf-4 -Wa,armasm,--pd,"__MICROLIB SETA 1" -I ../Core/Inc -I ../AZURE_RTOS/App -I ../Drivers/STM32H5xx_HAL_Driver/Inc -I ../Drivers/STM32H5xx_HAL_Driver/Inc/Legacy -I ../Middlewares/ST/threadx/common/inc -I ../Drivers/CMSIS/Device/ST/STM32H5xx/Include -I ../Middlewares/ST/threadx/ports/cortex_m33/ac6/inc -I ../Drivers/CMSIS/Include | ||||||
|  |  | ||||||
| -I./RTE/_AutoGuideStick | -I./RTE/_AutoGuideStick | ||||||
| @@ -141,8 +141,8 @@ I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_tim_ex.h)(0x683FA4DD) | |||||||
| -ID:/keil5/ARM/PACK/Keil/STM32H5xx_DFP/1.3.0/Drivers/CMSIS/Device/ST/STM32H5xx/Include | -ID:/keil5/ARM/PACK/Keil/STM32H5xx_DFP/1.3.0/Drivers/CMSIS/Device/ST/STM32H5xx/Include | ||||||
|  |  | ||||||
| -D__UVISION_VERSION="539" -D_RTE_ -DSTM32H563xx -D_RTE_ -DTX_INCLUDE_USER_DEFINE_FILE -DTX_SINGLE_MODE_NON_SECURE="1" -DUSE_HAL_DRIVER -DSTM32H563xx | -D__UVISION_VERSION="539" -D_RTE_ -DSTM32H563xx -D_RTE_ -DTX_INCLUDE_USER_DEFINE_FILE -DTX_SINGLE_MODE_NON_SECURE="1" -DUSE_HAL_DRIVER -DSTM32H563xx | ||||||
|  |  | ||||||
| -o autoguidestick/gpdma.o -MD) | -o autoguidestick/gpdma.o -MD) | ||||||
| I (..\Core\Inc\main.hc.\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal.h)(0x00000000) | I (..\Core\Inc\main.hc.\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal.h)(0x00000000) | ||||||
| I (..\Core\Inc\stm32h5xx_hal_conf.h)(0x685C2A98) | I (..\Core\Inc\stm32h5xx_hal_conf.h)(0x685C2A98) | ||||||
| I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_rcc.h)(0x683FA4DD) | I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_rcc.h)(0x683FA4DD) | ||||||
| @@ -216,7 +216,7 @@ I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_tim_ex.h)(0x683FA4DD) | |||||||
| I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_flash_ex.h)(0x683FA4DD) | I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_flash_ex.h)(0x683FA4DD) | ||||||
| I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_pwr.h)(0x683FA4DD) | I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_pwr.h)(0x683FA4DD) | ||||||
| I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_pwr_ex.h)(0x683FA4DD) | I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_pwr_ex.h)(0x683FA4DD) | ||||||
| I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_tim.h)(0x683FA4DD) | I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_tim.h)(0x683FA4DD) | ||||||
| I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_tim_ex.h)(0x683FA4DD) | I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_tim_ex.h)(0x683FA4DD) | ||||||
| I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_uart.h)(0x683FA4DD) | I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_uart.h)(0x683FA4DD) | ||||||
| I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_uart_ex.h)(0x683FA4DD) | I (..\Drivers\STM32H5xx_HAL_Driver\Inc\stm32h5xx_hal_uart_ex.h)(0x683FA4DD) | ||||||
| @@ -2074,7 +2074,7 @@ I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9) | |||||||
|  |  | ||||||
| -o autoguidestick/tx_event_flags_info_get.o -MD) | -o autoguidestick/tx_event_flags_info_get.o -MD) | ||||||
| I (..\Middlewares\ST\threadx\common\inc\tx_api.h)(0x683FA4DA) | I (..\Middlewares\ST\threadx\common\inc\tx_api.h)(0x683FA4DA) | ||||||
| I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9) | I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9) | ||||||
| I (..\Core\Inc\tx_user.he:\keil5\ARM\ARMCLANG\include\stdlib.h)(0x00000000) | I (..\Core\Inc\tx_user.he:\keil5\ARM\ARMCLANG\include\stdlib.h)(0x00000000) | ||||||
| I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012) | I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012) | ||||||
| I (..\Middlewares\ST\threadx\common\inc\tx_trace.h)(0x683FA4DA) | I (..\Middlewares\ST\threadx\common\inc\tx_trace.h)(0x683FA4DA) | ||||||
| @@ -2118,7 +2118,7 @@ I (..\fun\Shake_Motor.hG.\fun\Ultrasound.h..\fun\Buzzer.h)(0x00000000) | |||||||
| I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9) | I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9) | ||||||
| I (..\Core\Inc\tx_user.he:\keil5\ARM\ARMCLANG\include\stdlib.h)(0x00000000) | I (..\Core\Inc\tx_user.he:\keil5\ARM\ARMCLANG\include\stdlib.h)(0x00000000) | ||||||
| I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012) | I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012) | ||||||
| I (..\Middlewares\ST\threadx\common\inc\tx_trace.h)(0x683FA4DA) | I (..\Middlewares\ST\threadx\common\inc\tx_trace.h)(0x683FA4DA) | ||||||
| I (..\Middlewares\ST\threadx\common\inc\tx_thread.h)(0x683FA4DA) | I (..\Middlewares\ST\threadx\common\inc\tx_thread.h)(0x683FA4DA) | ||||||
| I (..\Middlewares\ST\threadx\common\inc\tx_event_flags.h)(0x683FA4DA) | I (..\Middlewares\ST\threadx\common\inc\tx_event_flags.h)(0x683FA4DA) | ||||||
| F (../Middlewares/ST/threadx/common/src/tx_event_flags_set_notify.c)(0x683FA4DA)(-xc -std=c11 --target=arm-arm-none-eabi -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -c | F (../Middlewares/ST/threadx/common/src/tx_event_flags_set_notify.c)(0x683FA4DA)(-xc -std=c11 --target=arm-arm-none-eabi -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -c | ||||||
| @@ -2160,7 +2160,7 @@ I (D:\keil5\ARM\ARMCLANG\include\stdio.h)(0x6569B012) | |||||||
| I (..\Middlewares\ST\threadx\common\inc\tx_api.h)(0x683FA4DA) | I (..\Middlewares\ST\threadx\common\inc\tx_api.h)(0x683FA4DA) | ||||||
| I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9) | I (..\Middlewares\ST\threadx\ports\cortex_m33\ac6\inc\tx_port.h)(0x683FA4D9) | ||||||
| I (..\Core\Inc\tx_user.he:\keil5\ARM\ARMCLANG\include\stdlib.h)(0x00000000) | I (..\Core\Inc\tx_user.he:\keil5\ARM\ARMCLANG\include\stdlib.h)(0x00000000) | ||||||
| I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012) | I (D:\keil5\ARM\ARMCLANG\include\string.h)(0x6569B012) | ||||||
| I (..\Middlewares\ST\threadx\common\inc\tx_thread.h)(0x683FA4DA) | I (..\Middlewares\ST\threadx\common\inc\tx_thread.h)(0x683FA4DA) | ||||||
| I (..\Middlewares\ST\threadx\common\inc\tx_mutex.h)(0x683FA4DA) | I (..\Middlewares\ST\threadx\common\inc\tx_mutex.h)(0x683FA4DA) | ||||||
| F (../Middlewares/ST/threadx/common/src/tx_mutex_create.c)(0x683FA4DA)(-xc -std=c11 --target=arm-arm-none-eabi -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -c | F (../Middlewares/ST/threadx/common/src/tx_mutex_create.c)(0x683FA4DA)(-xc -std=c11 --target=arm-arm-none-eabi -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -c | ||||||
| @@ -2293,7 +2293,7 @@ I (D:\keil5\ARM\ARMCLANG\include\stdarg.h)(0x6569B012) | |||||||
| I (..\Middlewares\ST\threadx\common\inc\tx_thread.h)(0x683FA4DA) | I (..\Middlewares\ST\threadx\common\inc\tx_thread.h)(0x683FA4DA) | ||||||
| I (..\Middlewares\ST\threadx\common\inc\tx_mutex.h)(0x683FA4DA) | I (..\Middlewares\ST\threadx\common\inc\tx_mutex.h)(0x683FA4DA) | ||||||
| F (../Middlewares/ST/threadx/common/src/tx_mutex_priority_change.c)(0x683FA4DA)(-xc -std=c11 --target=arm-arm-none-eabi -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -c | F (../Middlewares/ST/threadx/common/src/tx_mutex_priority_change.c)(0x683FA4DA)(-xc -std=c11 --target=arm-arm-none-eabi -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -c | ||||||
|  |  | ||||||
| -fno-rtti -funsigned-char -fshort-enums -fshort-wchar | -fno-rtti -funsigned-char -fshort-enums -fshort-wchar | ||||||
|  |  | ||||||
| -D__MICROLIB -gdwarf-4 -O0 -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -Wno-reserved-identifier -I ../Core/Inc -I ../AZURE_RTOS/App -I ../Drivers/STM32H5xx_HAL_Driver/Inc -I ../Drivers/STM32H5xx_HAL_Driver/Inc/Legacy -I ../Middlewares/ST/threadx/common/inc -I ../Drivers/CMSIS/Device/ST/STM32H5xx/Include -I ../Middlewares/ST/threadx/ports/cortex_m33/ac6/inc -I ../Drivers/CMSIS/Include -I ../fun | -D__MICROLIB -gdwarf-4 -O0 -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -Wno-reserved-identifier -I ../Core/Inc -I ../AZURE_RTOS/App -I ../Drivers/STM32H5xx_HAL_Driver/Inc -I ../Drivers/STM32H5xx_HAL_Driver/Inc/Legacy -I ../Middlewares/ST/threadx/common/inc -I ../Drivers/CMSIS/Device/ST/STM32H5xx/Include -I ../Middlewares/ST/threadx/ports/cortex_m33/ac6/inc -I ../Drivers/CMSIS/Include -I ../fun | ||||||
| @@ -2335,7 +2335,7 @@ I (D:\keil5\ARM\ARMCLANG\include\stdio.h)(0x6569B012) | |||||||
| I (..\Middlewares\ST\threadx\common\inc\tx_trace.h)(0x683FA4DA) | I (..\Middlewares\ST\threadx\common\inc\tx_trace.h)(0x683FA4DA) | ||||||
| I (..\Middlewares\ST\threadx\common\inc\tx_thread.h)(0x683FA4DA) | I (..\Middlewares\ST\threadx\common\inc\tx_thread.h)(0x683FA4DA) | ||||||
| I (..\Middlewares\ST\threadx\common\inc\tx_mutex.h)(0x683FA4DA) | I (..\Middlewares\ST\threadx\common\inc\tx_mutex.h)(0x683FA4DA) | ||||||
| F (../Middlewares/ST/threadx/common/src/tx_queue_cleanup.c)(0x683FA4DA)(-xc -std=c11 --target=arm-arm-none-eabi -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -c | F (../Middlewares/ST/threadx/common/src/tx_queue_cleanup.c)(0x683FA4DA)(-xc -std=c11 --target=arm-arm-none-eabi -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -c | ||||||
|  |  | ||||||
| -fno-rtti -funsigned-char -fshort-enums -fshort-wchar | -fno-rtti -funsigned-char -fshort-enums -fshort-wchar | ||||||
|  |  | ||||||
| @@ -2379,7 +2379,7 @@ I (D:\keil5\ARM\ARMCLANG\include\stdarg.h)(0x6569B012) | |||||||
| I (..\Middlewares\ST\threadx\common\inc\tx_queue.h)(0x683FA4DA) | I (..\Middlewares\ST\threadx\common\inc\tx_queue.h)(0x683FA4DA) | ||||||
| F (../Middlewares/ST/threadx/common/src/tx_queue_delete.c)(0x683FA4DA)(-xc -std=c11 --target=arm-arm-none-eabi -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -c | F (../Middlewares/ST/threadx/common/src/tx_queue_delete.c)(0x683FA4DA)(-xc -std=c11 --target=arm-arm-none-eabi -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -c | ||||||
|  |  | ||||||
| -fno-rtti -funsigned-char -fshort-enums -fshort-wchar | -fno-rtti -funsigned-char -fshort-enums -fshort-wchar | ||||||
|  |  | ||||||
| -D__MICROLIB -gdwarf-4 -O0 -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -Wno-reserved-identifier -I ../Core/Inc -I ../AZURE_RTOS/App -I ../Drivers/STM32H5xx_HAL_Driver/Inc -I ../Drivers/STM32H5xx_HAL_Driver/Inc/Legacy -I ../Middlewares/ST/threadx/common/inc -I ../Drivers/CMSIS/Device/ST/STM32H5xx/Include -I ../Middlewares/ST/threadx/ports/cortex_m33/ac6/inc -I ../Drivers/CMSIS/Include -I ../fun | -D__MICROLIB -gdwarf-4 -O0 -ffunction-sections -Wno-packed -Wno-missing-variable-declarations -Wno-missing-prototypes -Wno-missing-noreturn -Wno-sign-conversion -Wno-nonportable-include-path -Wno-reserved-id-macro -Wno-unused-macros -Wno-documentation-unknown-command -Wno-documentation -Wno-license-management -Wno-parentheses-equality -Wno-reserved-identifier -I ../Core/Inc -I ../AZURE_RTOS/App -I ../Drivers/STM32H5xx_HAL_Driver/Inc -I ../Drivers/STM32H5xx_HAL_Driver/Inc/Legacy -I ../Middlewares/ST/threadx/common/inc -I ../Drivers/CMSIS/Device/ST/STM32H5xx/Include -I ../Middlewares/ST/threadx/ports/cortex_m33/ac6/inc -I ../Drivers/CMSIS/Include -I ../fun | ||||||
|  |  | ||||||
| @@ -2422,5 +2422,5 @@ I (D:\keil5\ARM\ARMCLANG\include\stdio.h)(0x6569B012) | |||||||
| I (..\Middlewares\ST\threadx\common\inc\tx_thread.h)(0x683FA4DA) | I (..\Middlewares\ST\threadx\common\inc\tx_thread.h)(0x683FA4DA) | ||||||
| I (..\Middlewares\ST\threadx\common\inc\tx_queue.h)(0x683FA4DA) | I (..\Middlewares\ST\threadx\common\inc\tx_queue.h)(0x683FA4DA) | ||||||
| F (../Middlewares/ST/threadx/common/src/tx_queue_front_send.c)(0x683FA4DA)(-xc -std=c11 --target=arm-arm-none-eabi -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -c | F (../Middlewares/ST/threadx/common/src/tx_queue_front_send.c)(0x683FA4DA)(-xc -std=c11 --target=arm-arm-none-eabi -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -c | ||||||
|  |  | ||||||
| -fno-rtti -funsigned-char -fshort-enums -fshort-wchar | -fno-rtti -funsigned-char -fshort-enums -fshort-wchar | ||||||
|   | |||||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										20
									
								
								fun/HCBle.c
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								fun/HCBle.c
									
									
									
									
									
								
							| @@ -42,6 +42,7 @@ TX_EVENT_FLAGS_GROUP ble_event_flags; | |||||||
|  |  | ||||||
| void HCBle_InitEventFlags(void) | void HCBle_InitEventFlags(void) | ||||||
| {	tx_event_flags_create(&ble_event_flags, "BLE Events"); | {	tx_event_flags_create(&ble_event_flags, "BLE Events"); | ||||||
|  | 	tx_event_flags_create(&system_events,"gps Events"); | ||||||
| //	tx_event_flags_create(&sensor_events,"Sensor Events"); | //	tx_event_flags_create(&sensor_events,"Sensor Events"); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -101,15 +102,17 @@ void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size) | |||||||
|     } |     } | ||||||
| 	else if(huart->Instance == USART2) // gps<70>Ľ<EFBFBD><C4BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | 	else if(huart->Instance == USART2) // gps<70>Ľ<EFBFBD><C4BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | ||||||
| 	{ | 	{ | ||||||
|  | 		 | ||||||
| 		//		// <20><><EFBFBD><EFBFBD> Size <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | 		//		// <20><><EFBFBD><EFBFBD> Size <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | ||||||
| 		memcpy(GPS.GPS_Buffer,GPS_DMA_RX_BUF,Size); | 		memcpy(GPS.GPS_Buffer,GPS_DMA_RX_BUF,Size); | ||||||
| 		GPS.GPS_Buffer[Size] = '\0'; | 		GPS.GPS_Buffer[Size] = '\0'; | ||||||
| 		GPS.isGetData = 1;  //<2F><><EFBFBD>ݽ<EFBFBD><DDBD>ձ<EFBFBD>־λ<D6BE><CEBB>Ϊ1 | 		GPS.isGetData = 1;  //<2F><><EFBFBD>ݽ<EFBFBD><DDBD>ձ<EFBFBD>־λ<D6BE><CEBB>Ϊ1 | ||||||
| 		 | 		 | ||||||
| 		tx_event_flags_set(&system_events, EVENT_GPS_DATA_READY, TX_OR); | 		tx_event_flags_set(&system_events, EVENT_GPS_DATA_READY, TX_OR); | ||||||
|  |  | ||||||
| 		//<2F><><EFBFBD>¿<EFBFBD><C2BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | 		//<2F><><EFBFBD>¿<EFBFBD><C2BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | ||||||
| 		HAL_UARTEx_ReceiveToIdle_IT(&huart2,GPS_DMA_RX_BUF,GPS_DMA_RX_BUF_LEN); | 		HAL_UARTEx_ReceiveToIdle_IT(&huart2,GPS_DMA_RX_BUF,GPS_DMA_RX_BUF_LEN); | ||||||
|  | //		HAL_UARTEx_ReceiveToIdle_DMA(&huart2,GPS_DMA_RX_BUF,GPS_DMA_RX_BUF_LEN); | ||||||
| 	} | 	} | ||||||
| 	 | 	 | ||||||
| } | } | ||||||
| @@ -189,17 +192,16 @@ void ble_rx_task_entry(ULONG thread_input) | |||||||
| //                 HCBle_SendData("#{\"lat\":%.6f,\"lon\":%.6f,\"angle\":%.2f}\n",  | //                 HCBle_SendData("#{\"lat\":%.6f,\"lon\":%.6f,\"angle\":%.2f}\n",  | ||||||
| //                                  current_location.lat, current_location.lon, current_location.angle); | //                                  current_location.lat, current_location.lon, current_location.angle); | ||||||
| void ble_tx_task_entry(ULONG thread_input) { | void ble_tx_task_entry(ULONG thread_input) { | ||||||
| 	char recv_msg[128]; |  | ||||||
| 	BleMessage msg; | 	BleMessage msg; | ||||||
|     while(1) { |     while(1) { | ||||||
|  |  | ||||||
|         HCBle_SendData("#{\"lat\":%.6f,\"lon\":%.6f,\"angle\":%.2f}\n",23.123456, 113.654321, 95.0); | //        HCBle_SendData("#{\"lat\":%.6f,\"lon\":%.6f,\"angle\":%.2f}\n",23.123456, 113.654321, 95.0); | ||||||
|         tx_thread_sleep(500); | //        tx_thread_sleep(500); | ||||||
| //		if(tx_queue_receive(&ble_tx_queue,&msg,TX_WAIT_FOREVER) == TX_SUCCESS) | 		if(tx_queue_receive(&ble_tx_queue,&msg,TX_WAIT_FOREVER) == TX_SUCCESS) | ||||||
| //		{ | 		{ | ||||||
| //			HCBle_SendData("#{\"lat\":%.6f,\"lon\":%.6f,\"angle\":%.1f}\n",  | 			HCBle_SendData("#{\"lat\":%.6f,\"lon\":%.6f,\"angle\":%.1f}\n",  | ||||||
| //                              23.123456, 113.654321,msg.angle); |                               msg.lat, msg.lon,0); | ||||||
| //		} | 		} | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										258
									
								
								fun/gps.c
									
									
									
									
									
								
							
							
						
						
									
										258
									
								
								fun/gps.c
									
									
									
									
									
								
							| @@ -26,68 +26,215 @@ _GPSData GPS; | |||||||
| void GPS_Init(void) | void GPS_Init(void) | ||||||
| { | { | ||||||
|     HAL_UARTEx_ReceiveToIdle_IT(&huart2, GPS_DMA_RX_BUF, GPS_DMA_RX_BUF_LEN); |     HAL_UARTEx_ReceiveToIdle_IT(&huart2, GPS_DMA_RX_BUF, GPS_DMA_RX_BUF_LEN); | ||||||
| //    __HAL_DMA_DISABLE_IT(&handle_GPDMA1_Channel3, DMA_IT_HT);  // <20><><EFBFBD>ð봫<C3B0><EBB4AB> | //		HAL_UARTEx_ReceiveToIdle_DMA(&huart2,GPS_DMA_RX_BUF,GPS_DMA_RX_BUF_LEN); | ||||||
| } | } | ||||||
|  |  | ||||||
| #ifdef parse | #ifdef parse | ||||||
| // GPS<50><53><EFBFBD>ݽ<EFBFBD><DDBD><EFBFBD> | // GPS<50><53><EFBFBD>ݽ<EFBFBD><DDBD><EFBFBD> | ||||||
| void parseGpsBuffer() | //void parseGpsBuffer() | ||||||
| { | //{ | ||||||
| 	char *subString; | //	char *subString; | ||||||
| 	char *subStringNext; | //	char *subStringNext; | ||||||
| 	char i = 0; | //	char i = 0; | ||||||
|  | //	 | ||||||
|  | //	if(GPS.isGetData) | ||||||
|  | //	{ | ||||||
|  | //		GPS.isGetData = 0; // <20>ѱ<EFBFBD>־λ<D6BE><CEBB>Ϊ1 | ||||||
|  | //		 | ||||||
|  | //		char usefullBuffer[2] = {0}; | ||||||
|  | //		for(i = 0; i <= 6; i++) | ||||||
|  | //		{ | ||||||
|  | //			if(i == 0) | ||||||
|  | //			{ | ||||||
|  | //				 | ||||||
|  | //				subString = strstr(GPS.GPS_Buffer,","); | ||||||
|  | //				if(!subString)return; | ||||||
|  | //			} | ||||||
|  | //			else | ||||||
|  | //			{ | ||||||
|  | //				subString++; | ||||||
|  | //				subStringNext = strstr(subString,","); | ||||||
|  | //				if(!subStringNext)return; | ||||||
|  | //				 | ||||||
|  | //				switch(i) | ||||||
|  | //				{ | ||||||
|  | //					case 1: | ||||||
|  | //						memcpy(GPS.UTCTime,subString,subStringNext - subString); | ||||||
|  | //						break; | ||||||
|  | //					case 2: | ||||||
|  | //						memcpy(usefullBuffer,subString,subStringNext - subString); | ||||||
|  | //						break; | ||||||
|  | //					case 3: | ||||||
|  | //						memcpy(GPS.latitude,subString,subStringNext - subString); | ||||||
|  | //						break; | ||||||
|  | //					case 4: | ||||||
|  | //						memcpy(GPS.N_S,subString,subStringNext - subString); | ||||||
|  | //						break; | ||||||
|  | //					case 5: | ||||||
|  | //						memcpy(GPS.longitude,subString,subStringNext - subString); | ||||||
|  | //						break; | ||||||
|  | //					case 6: | ||||||
|  | //						memcpy(GPS.E_W,subString,subStringNext - subString); | ||||||
|  | //						break; | ||||||
|  | //					default:break; | ||||||
|  | //				} | ||||||
|  | //				 | ||||||
|  | //				subString = subStringNext; | ||||||
|  | //			} | ||||||
|  | //			 | ||||||
|  | //		} | ||||||
|  | //		GPS.isParseData = 1; | ||||||
|  | //		GPS.isUsefull = (usefullBuffer[0] == 'A') ? 1 : 0; | ||||||
|  | //	} | ||||||
|  | //	 | ||||||
|  | //} | ||||||
|  |  | ||||||
| 	if(GPS.isGetData) |  | ||||||
| 	{ |  | ||||||
| 		GPS.isGetData = 0; // <20>ѱ<EFBFBD>־λ<D6BE><CEBB>Ϊ1 |  | ||||||
|  |  | ||||||
| 		char usefullBuffer[2] = {0}; | //void parseGpsBuffer(void) | ||||||
| 		for(i = 0; i <= 6; i++) | //{ | ||||||
| 		{ | //    if (!GPS.isGetData) return; | ||||||
| 			if(i == 0) | //    GPS.isGetData = 0; | ||||||
| 			{ |  | ||||||
|  |  | ||||||
| 				subString = strstr(GPS.GPS_Buffer,","); | //    /* ----------- <20><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD> ------------ */ | ||||||
| 				if(!subString)return; | //    const char *p = GPS.GPS_Buffer; | ||||||
|  |  | ||||||
|  | //    /* <20><> RMC ----------------------------------------------------- */ | ||||||
|  | //    if (!strncmp(p, "$GNRMC", 6) || !strncmp(p, "$GPRMC", 6)) | ||||||
|  | //    { | ||||||
|  | //        char status, lat[16], ns[3], lon[16], ew[3]; | ||||||
|  | //        if (sscanf(p, | ||||||
|  | //                   "$%*[^,],%*[^,],%c,%15[^,],%2[^,],%15[^,],%2[^,],", | ||||||
|  | //                   &status, lat, ns, lon, ew) == 5) | ||||||
|  | //        { | ||||||
|  | //            if (status == 'A')                      /* <20><>λ<EFBFBD><CEBB>Ч */ | ||||||
|  | //            { | ||||||
|  | //                strcpy(GPS.latitude,  lat); | ||||||
|  | //                strcpy(GPS.N_S,       ns); | ||||||
|  | //                strcpy(GPS.longitude, lon); | ||||||
|  | //                strcpy(GPS.E_W,       ew); | ||||||
|  | //                GPS.isParseData = 1; | ||||||
|  | //                GPS.isUsefull   = 1; | ||||||
|  | //            } | ||||||
|  | //        } | ||||||
|  | //        return; | ||||||
|  | //    } | ||||||
|  |  | ||||||
|  | //    /* <20><> GGA ----------------------------------------------------- */ | ||||||
|  | //    if (!strncmp(p, "$GNGGA", 6) || !strncmp(p, "$GPGGA", 6)) | ||||||
|  | //    { | ||||||
|  | //        int q;  char lat[16], ns[3], lon[16], ew[3]; | ||||||
|  | //        if (sscanf(p, | ||||||
|  | //                   "$%*[^,],%*[^,],%15[^,],%2[^,],%15[^,],%2[^,],%d,", | ||||||
|  | //                   lat, ns, lon, ew, &q) == 5) | ||||||
|  | //        { | ||||||
|  | //            if (q > 0)                              /* q=0 <20><EFBFBD>λ */ | ||||||
|  | //            { | ||||||
|  | //                strcpy(GPS.latitude,  lat); | ||||||
|  | //                strcpy(GPS.N_S,       ns); | ||||||
|  | //                strcpy(GPS.longitude, lon); | ||||||
|  | //                strcpy(GPS.E_W,       ew); | ||||||
|  | //                GPS.isParseData = 1; | ||||||
|  | //                GPS.isUsefull   = 1; | ||||||
|  | //            } | ||||||
|  | //        } | ||||||
|  | //        return; | ||||||
|  | //    } | ||||||
|  |  | ||||||
|  | //    /* <20><> GLL ----------------------------------------------------- */ | ||||||
|  | //    if (!strncmp(p, "$GNGLL", 6) || !strncmp(p, "$GPGLL", 6)) | ||||||
|  | //    { | ||||||
|  | //        char status, lat[16], ns[3], lon[16], ew[3]; | ||||||
|  | //        if (sscanf(p, | ||||||
|  | //                   "$%*[^,],%15[^,],%2[^,],%15[^,],%2[^,],%*[^,],%c", | ||||||
|  | //                   lat, ns, lon, ew, &status) == 5) | ||||||
|  | //        { | ||||||
|  | //            if (status == 'A') | ||||||
|  | //            { | ||||||
|  | //                strcpy(GPS.latitude,  lat); | ||||||
|  | //                strcpy(GPS.N_S,       ns); | ||||||
|  | //                strcpy(GPS.longitude, lon); | ||||||
|  | //                strcpy(GPS.E_W,       ew); | ||||||
|  | //                GPS.isParseData = 1; | ||||||
|  | //                GPS.isUsefull   = 1; | ||||||
|  | //            } | ||||||
|  | //        } | ||||||
|  | //    } | ||||||
|  | //} | ||||||
|  |  | ||||||
|  | /* === <20><> <20>л<EFBFBD><D0BB><EFBFBD><EFBFBD><EFBFBD> & <20><><EFBFBD>ͺ<EFBFBD><CDBA><EFBFBD> === */ | ||||||
|  | static char line_buf[GPS_Buffer_Length]; | ||||||
|  | static uint16_t line_w = 0; | ||||||
|  |  | ||||||
|  | void GPS_LinePush(uint8_t ch) | ||||||
|  | { | ||||||
|  |     if (ch == '\n') {                     /* <20><><EFBFBD><EFBFBD><EFBFBD>н<EFBFBD><D0BD><EFBFBD> */ | ||||||
|  |         line_buf[line_w] = '\0'; | ||||||
|  |  | ||||||
|  |  | ||||||
|  |         /* A. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '$' <20><>ͷ<EFBFBD><CDB7>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD><EFBFBD><EFBFBD> <20><> ֱ<><D6B1>ƴ<EFBFBD><C6B4> */ | ||||||
|  |         if (line_buf[0] != '$' && GPS.isGetData == 0 && GPS.GPS_Buffer[0] == '$') | ||||||
|  |         { | ||||||
|  |             strncat(GPS.GPS_Buffer, line_buf, GPS_Buffer_Length - strlen(GPS.GPS_Buffer) - 1); | ||||||
|         } |         } | ||||||
| 			else |         else        /* B. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¾<EFBFBD> */ | ||||||
|         { |         { | ||||||
| 				subString++; |             strncpy(GPS.GPS_Buffer, line_buf, GPS_Buffer_Length); | ||||||
| 				subStringNext = strstr(subString,","); |  | ||||||
| 				if(!subStringNext)return; |  | ||||||
| 				 |  | ||||||
| 				switch(i) |  | ||||||
| 				{ |  | ||||||
| 					case 1: |  | ||||||
| 						memcpy(GPS.UTCTime,subString,subStringNext - subString); |  | ||||||
| 						break; |  | ||||||
| 					case 2: |  | ||||||
| 						memcpy(usefullBuffer,subString,subStringNext - subString); |  | ||||||
| 						break; |  | ||||||
| 					case 3: |  | ||||||
| 						memcpy(GPS.latitude,subString,subStringNext - subString); |  | ||||||
| 						break; |  | ||||||
| 					case 4: |  | ||||||
| 						memcpy(GPS.N_S,subString,subStringNext - subString); |  | ||||||
| 						break; |  | ||||||
| 					case 5: |  | ||||||
| 						memcpy(GPS.longitude,subString,subStringNext - subString); |  | ||||||
| 						break; |  | ||||||
| 					case 6: |  | ||||||
| 						memcpy(GPS.E_W,subString,subStringNext - subString); |  | ||||||
| 						break; |  | ||||||
| 					default:break; |  | ||||||
|         } |         } | ||||||
|  |  | ||||||
| 				subString = subStringNext; |         line_w = 0; | ||||||
|  |         GPS.isGetData = 1; | ||||||
|  |         tx_event_flags_set(&system_events, EVENT_GPS_DATA_READY, TX_OR); | ||||||
|  |         return; | ||||||
|  |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | /* === <20><> <20>½<EFBFBD><C2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻҪ<D6BB><D2AA>γ<EFBFBD><CEB3> === */ | ||||||
|  | void parseGpsBuffer(void) | ||||||
|  | { | ||||||
|  |     if (!GPS.isGetData) return; | ||||||
|  |     GPS.isGetData = 0; | ||||||
|  |     GPS.isParseData = 0; | ||||||
|  |     GPS.isUsefull  = 0; | ||||||
|  |  | ||||||
|  |     const char *p = GPS.GPS_Buffer; | ||||||
|  |     /* ---- $GxRMC ---- */ | ||||||
|  |     if (!strncmp(p, "$GNRMC", 6) || !strncmp(p, "$GPRMC", 6)) { | ||||||
|  |         char s, lat[16], ns[3], lon[16], ew[3]; | ||||||
|  |         if (sscanf(p, | ||||||
|  |                    "$%*[^,],%*[^,],%c,%15[^,],%2[^,],%15[^,],%2[^,],", | ||||||
|  |                    &s, lat, ns, lon, ew) == 5 && s == 'A') { | ||||||
|  |             strcpy(GPS.latitude, lat); strcpy(GPS.N_S, ns); | ||||||
|  |             strcpy(GPS.longitude, lon); strcpy(GPS.E_W, ew); | ||||||
|  |             GPS.isParseData = GPS.isUsefull = 1; | ||||||
|  |         } | ||||||
|  |         return; | ||||||
|  |     } | ||||||
|  |     /* ---- $GxGGA ---- */ | ||||||
|  |     if (!strncmp(p, "$GNGGA", 6) || !strncmp(p, "$GPGGA", 6)) { | ||||||
|  |         int q; char lat[16], ns[3], lon[16], ew[3]; | ||||||
|  |         if (sscanf(p, | ||||||
|  |             "$%*[^,],%*[^,],%15[^,],%2[^,],%15[^,],%2[^,],%d,", | ||||||
|  |             lat, ns, lon, ew, &q) == 5 && q > 0) { | ||||||
|  |             strcpy(GPS.latitude, lat); strcpy(GPS.N_S, ns); | ||||||
|  |             strcpy(GPS.longitude, lon); strcpy(GPS.E_W, ew); | ||||||
|  |             GPS.isParseData = GPS.isUsefull = 1; | ||||||
|  |         } | ||||||
|  |         return; | ||||||
|  |     } | ||||||
|  |     /* ---- $GxGLL ---- */ | ||||||
|  |     if (!strncmp(p, "$GNGLL", 6) || !strncmp(p, "$GPGLL", 6)) { | ||||||
|  |         char s, lat[16], ns[3], lon[16], ew[3]; | ||||||
|  |         if (sscanf(p, | ||||||
|  |             "$%*[^,],%15[^,],%2[^,],%15[^,],%2[^,],%*[^,],%c", | ||||||
|  |             lat, ns, lon, ew, &s) == 5 && s == 'A') { | ||||||
|  |             strcpy(GPS.latitude, lat); strcpy(GPS.N_S, ns); | ||||||
|  |             strcpy(GPS.longitude, lon); strcpy(GPS.E_W, ew); | ||||||
|  |             GPS.isParseData = GPS.isUsefull = 1; | ||||||
|  |         } | ||||||
|     } |     } | ||||||
| 		GPS.isParseData = 1; |  | ||||||
| 		GPS.isUsefull = (usefullBuffer[0] == 'A') ? 1 : 0; |  | ||||||
| } | } | ||||||
|  |  | ||||||
| } |  | ||||||
| #else // <20><><EFBFBD><EFBFBD><EFBFBD>Ƕ<EFBFBD><C7B6>ڸĽ<DAB8><C4BD><EFBFBD><EFBFBD><EFBFBD>parse <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>в<EFBFBD><D0B2><EFBFBD> | #else // <20><><EFBFBD><EFBFBD><EFBFBD>Ƕ<EFBFBD><C7B6>ڸĽ<DAB8><C4BD><EFBFBD><EFBFBD><EFBFBD>parse <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>в<EFBFBD><D0B2><EFBFBD> | ||||||
| void parseGpsBuffer() | void parseGpsBuffer() | ||||||
| { | { | ||||||
| @@ -172,7 +319,7 @@ void GPS_Data_CLR(void) | |||||||
| //		 | //		 | ||||||
| //		tx_event_flags_set(&system_events, EVENT_GPS_DATA_READY, TX_OR); | //		tx_event_flags_set(&system_events, EVENT_GPS_DATA_READY, TX_OR); | ||||||
| //		//<2F><><EFBFBD>¿<EFBFBD><C2BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | //		//<2F><><EFBFBD>¿<EFBFBD><C2BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | ||||||
| //		HAL_UARTEx_ReceiveToIdle_DMA(&huart2,GPS_DMA_RX_BUF,GPS_DMA_RX_BUF_LEN); | //		HAL_UARTEx_ReceiveToIdle_IT(&huart2,GPS_DMA_RX_BUF,GPS_DMA_RX_BUF_LEN); | ||||||
| //	} | //	} | ||||||
| //	 | //	 | ||||||
| //} | //} | ||||||
| @@ -186,25 +333,28 @@ void gps_thread_entry(ULONG thread_input) | |||||||
| { | { | ||||||
|     GPS_Init(); |     GPS_Init(); | ||||||
|     static int gps_first_fix_sent = 0; |     static int gps_first_fix_sent = 0; | ||||||
|  | 	BleMessage msg; | ||||||
|     while (1) |     while (1) | ||||||
|     { |     { | ||||||
|         ULONG events; |         ULONG events; | ||||||
|         tx_event_flags_get(&system_events, EVENT_GPS_DATA_READY, TX_OR_CLEAR, &events, TX_WAIT_FOREVER); |         tx_event_flags_get(&system_events, EVENT_GPS_DATA_READY, TX_OR_CLEAR, &events, TX_WAIT_FOREVER); | ||||||
|  |  | ||||||
|         parseGpsBuffer(); |         parseGpsBuffer(); | ||||||
|  | //		HCBle_SendData("[GPS] isGetData=%d, isParseData=%d, isUsefull=%d, Buffer=%s\r\n", | ||||||
|  | //		GPS.isGetData, GPS.isParseData, GPS.isUsefull, GPS.GPS_Buffer); | ||||||
|         if (GPS.isParseData && GPS.isUsefull) |         if (GPS.isParseData && GPS.isUsefull) | ||||||
|         { |         { | ||||||
|             current_location.lat = Convert_to_degrees(GPS.latitude); |             current_location.lat = Convert_to_degrees(GPS.latitude); | ||||||
|             current_location.lon = Convert_to_degrees(GPS.longitude); |             current_location.lon = Convert_to_degrees(GPS.longitude); | ||||||
|             tx_event_flags_set(&system_events, EVENT_LOCATION_UPDATED, TX_OR); |             tx_event_flags_set(&system_events, EVENT_LOCATION_UPDATED, TX_OR); | ||||||
|  |  | ||||||
|             char msg[128]; | 			 | ||||||
|             snprintf(msg, sizeof(msg), "#{\"lat\":%.6f,\"lon\":%.6f,\"angle\":%.2f}\n", | 			msg.lat = current_location.lat; | ||||||
|                      current_location.lat, | 			msg.lon = current_location.lon; | ||||||
|                      current_location.lon, | //            snprintf(msg, sizeof(msg), "#{\"lat\":%.6f,\"lon\":%.6f,\"angle\":%.2f}\n", | ||||||
|                      current_location.angle); | //                     current_location.lat, | ||||||
|  | //                     current_location.lon, | ||||||
|  | //                     current_location.angle); | ||||||
|             tx_queue_send(&ble_tx_queue, &msg, TX_WAIT_FOREVER); |             tx_queue_send(&ble_tx_queue, &msg, TX_WAIT_FOREVER); | ||||||
|  |  | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -6,11 +6,11 @@ | |||||||
| #define USART_REC_LEN			200	 | #define USART_REC_LEN			200	 | ||||||
| #define EN_USART2_RX			1  //ʹ<>ܽ<EFBFBD><DCBD><EFBFBD> --- 1 <20><>֮ 0 | #define EN_USART2_RX			1  //ʹ<>ܽ<EFBFBD><DCBD><EFBFBD> --- 1 <20><>֮ 0 | ||||||
|  |  | ||||||
| #define GPS_DMA_RX_BUF_LEN		200 //<2F>ɸ<EFBFBD><C9B8><EFBFBD>NMEA<45><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | #define GPS_DMA_RX_BUF_LEN		220 //<2F>ɸ<EFBFBD><C9B8><EFBFBD>NMEA<45><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | ||||||
|  |  | ||||||
|  |  | ||||||
| // <20><><EFBFBD><EFBFBD>gps<70>ṹ<EFBFBD><E1B9B9> | // <20><><EFBFBD><EFBFBD>gps<70>ṹ<EFBFBD><E1B9B9> | ||||||
| #define GPS_Buffer_Length 80 | #define GPS_Buffer_Length 256 | ||||||
| #define UTCTime_Length 11 | #define UTCTime_Length 11 | ||||||
| #define latitude_Length 11 | #define latitude_Length 11 | ||||||
| #define N_S_Length 2 | #define N_S_Length 2 | ||||||
| @@ -36,5 +36,6 @@ double Convert_to_degrees(char *data); | |||||||
| void parseGpsBuffer(); | void parseGpsBuffer(); | ||||||
| void gps_thread_entry(ULONG thread_input); | void gps_thread_entry(ULONG thread_input); | ||||||
| void GPS_Init(void); | void GPS_Init(void); | ||||||
|  | void GPS_LinePush(uint8_t ch); | ||||||
|  |  | ||||||
| #endif | #endif | ||||||
							
								
								
									
										13
									
								
								fun/imu948.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								fun/imu948.c
									
									
									
									
									
								
							| @@ -65,7 +65,7 @@ extern TX_QUEUE im948_uart_rx_queue; | |||||||
| void imu_angle_ble_task_entry(ULONG thread_input) | void imu_angle_ble_task_entry(ULONG thread_input) | ||||||
| { | { | ||||||
|     ULONG rx_data; |     ULONG rx_data; | ||||||
|  | 	BleMessage msg; | ||||||
|     // <20><>ʼ<EFBFBD><CABC>ģ<EFBFBD><C4A3> |     // <20><>ʼ<EFBFBD><CABC>ģ<EFBFBD><C4A3> | ||||||
| //    IM948_Init(); | //    IM948_Init(); | ||||||
| //			HCBle_SendData("halo"); | //			HCBle_SendData("halo"); | ||||||
| @@ -82,13 +82,12 @@ void imu_angle_ble_task_entry(ULONG thread_input) | |||||||
|         { |         { | ||||||
|             isNewData = 0; |             isNewData = 0; | ||||||
|  |  | ||||||
|             float angle = AngleZ; |             float angle = AngleZ * 0.0054931640625f; | ||||||
| 			HCBle_SendData("Z:%.2f\r\n",AngleZ); | //			msg.angle = AngleZ * 0.0054931640625f; | ||||||
|  | //			tx_queue_send(&ble_tx_queue, &msg, TX_WAIT_FOREVER); | ||||||
|  | //			HCBle_SendData("Z:%.2f\r\n",AngleZ); | ||||||
|             // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>angle<6C><65>ä<EFBFBD>ȳ<EFBFBD><C8B3><EFBFBD><EFBFBD>ж<EFBFBD> |             // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>angle<6C><65>ä<EFBFBD>ȳ<EFBFBD><C8B3><EFBFBD><EFBFBD>ж<EFBFBD> | ||||||
|             // <20><><EFBFBD><EFBFBD>: |  | ||||||
|             if(angle > 30.0f) { |  | ||||||
|                 // <20><><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD> |  | ||||||
|             } |  | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user