删除不用代码,确定led引脚,传感器数值正常范围正常
This commit is contained in:
parent
40961a85ea
commit
07968c8045
6
.config
6
.config
@ -906,7 +906,11 @@ CONFIG_PKG_CJSON_VER="v1.7.17"
|
|||||||
# CONFIG_PKG_USING_JSMN is not set
|
# CONFIG_PKG_USING_JSMN is not set
|
||||||
# CONFIG_PKG_USING_AGILE_JSMN is not set
|
# CONFIG_PKG_USING_AGILE_JSMN is not set
|
||||||
# CONFIG_PKG_USING_PARSON is not set
|
# CONFIG_PKG_USING_PARSON is not set
|
||||||
# CONFIG_PKG_USING_RYAN_JSON is not set
|
CONFIG_PKG_USING_RYAN_JSON=y
|
||||||
|
CONFIG_PKG_RYAN_JSON_PATH="/packages/language/JSON/RyanJson"
|
||||||
|
CONFIG_PKG_USING_RYAN_JSON_LATEST_VERSION=y
|
||||||
|
CONFIG_PKG_RYAN_JSON_VER="latest"
|
||||||
|
CONFIG_PKG_RYAN_JSON_VER_NUM=0xfff
|
||||||
# end of JSON: JavaScript Object Notation, a lightweight data-interchange format
|
# end of JSON: JavaScript Object Notation, a lightweight data-interchange format
|
||||||
|
|
||||||
#
|
#
|
||||||
|
2
.vscode/keil-assistant.log
vendored
2
.vscode/keil-assistant.log
vendored
@ -36,3 +36,5 @@
|
|||||||
|
|
||||||
[info] Log at : 2025/3/14|07:53:16|GMT+0800
|
[info] Log at : 2025/3/14|07:53:16|GMT+0800
|
||||||
|
|
||||||
|
[info] Log at : 2025/3/15|11:13:19|GMT+0800
|
||||||
|
|
||||||
|
200
.vscode/project.json
vendored
200
.vscode/project.json
vendored
@ -13,46 +13,46 @@
|
|||||||
"name": "ali-iotkit",
|
"name": "ali-iotkit",
|
||||||
"path": "packages\\ali-iotkit-v3.0.2",
|
"path": "packages\\ali-iotkit-v3.0.2",
|
||||||
"files": [
|
"files": [
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\infra\\infra_timer.c",
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\client\\dm_client.c",
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\mqtt\\impl\\MQTTUnsubscribeClient.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\ports\\rtthread\\HAL_UDP_rtthread.c",
|
"packages\\ali-iotkit-v3.0.2\\ports\\rtthread\\HAL_UDP_rtthread.c",
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\infra\\infra_net.c",
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\iotx_cm_mqtt.c",
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\mqtt\\impl\\MQTTPacket.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_fota.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_msg_process.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\infra\\infra_prt_nwk_payload.c",
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\infra\\infra_prt_nwk_payload.c",
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_message.c",
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\mqtt\\impl\\MQTTSubscribeClient.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\mqtt\\mqtt_api.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\client\\dm_client_adapter.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_msg_process.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\infra\\infra_defs.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_message_cache.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\ports\\rtthread\\HAL_TCP_rtthread.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\infra\\infra_sha256.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\impl_linkkit.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\ports\\rtthread\\HAL_OS_rtthread.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\mqtt\\impl\\MQTTSerializePublish.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_cota.c",
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\mqtt\\impl\\MQTTDeserializePublish.c",
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\mqtt\\impl\\MQTTDeserializePublish.c",
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_log_report.c",
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\infra\\infra_net.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\mqtt\\impl\\iotx_mqtt_client.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_sign\\dev_sign_mqtt.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\mqtt\\impl\\MQTTUnsubscribeClient.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_ipc.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_api.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\infra\\infra_cjson.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\infra\\infra_string.c",
|
||||||
"packages\\ali-iotkit-v3.0.2\\ports\\wrapper.c",
|
"packages\\ali-iotkit-v3.0.2\\ports\\wrapper.c",
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\infra\\infra_compat.c",
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\infra\\infra_compat.c",
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\client\\dm_client_adapter.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\mqtt\\impl\\iotx_mqtt_client.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\mqtt\\impl\\MQTTSerializePublish.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_ota.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\ports\\rtthread\\HAL_OS_rtthread.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\ports\\rtthread\\HAL_TCP_rtthread.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\infra\\infra_defs.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_cota.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\infra\\infra_string.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\impl_linkkit.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\infra\\infra_log.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_message_cache.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_utils.c",
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_utils.c",
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\mqtt\\impl\\MQTTSubscribeClient.c",
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_fota.c",
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\iotx_cm_mqtt.c",
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\infra\\infra_log.c",
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\mqtt\\mqtt_api.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\infra\\infra_sha256.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\iotx_cm.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_sign\\dev_sign_mqtt.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\client\\dm_client.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_opt.c",
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_opt.c",
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\mqtt\\impl\\MQTTConnectClient.c",
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\mqtt\\impl\\MQTTConnectClient.c",
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_manager.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\infra\\infra_cjson.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_api.c",
|
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\infra\\infra_report.c",
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\infra\\infra_report.c",
|
||||||
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_ipc.c",
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\infra\\infra_timer.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\iotx_cm.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_manager.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_message.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\mqtt\\impl\\MQTTPacket.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_ota.c",
|
||||||
|
"packages\\ali-iotkit-v3.0.2\\iotkit-embedded\\src\\dev_model\\dm_log_report.c",
|
||||||
"packages\\ali-iotkit-v3.0.2\\SConscript"
|
"packages\\ali-iotkit-v3.0.2\\SConscript"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -68,24 +68,24 @@
|
|||||||
"name": "Applications",
|
"name": "Applications",
|
||||||
"path": "applications",
|
"path": "applications",
|
||||||
"files": [
|
"files": [
|
||||||
"applications\\app_lcd.c",
|
"applications\\my_func.c",
|
||||||
"applications\\icm_20608_sample.c",
|
|
||||||
"applications\\motor.c",
|
|
||||||
"applications\\sensor.c",
|
"applications\\sensor.c",
|
||||||
"applications\\main.c",
|
"applications\\myinfrared.c",
|
||||||
"applications\\sim.c",
|
|
||||||
"applications\\AHT10.c",
|
|
||||||
"applications\\assistant.c",
|
|
||||||
"applications\\test_drv_example.c",
|
"applications\\test_drv_example.c",
|
||||||
"applications\\init.c",
|
"applications\\init.c",
|
||||||
"applications\\indicator_led.c",
|
"applications\\sim.c",
|
||||||
"applications\\pin_irq_example.c",
|
"applications\\motor.c",
|
||||||
"applications\\myinfrared.c",
|
|
||||||
"applications\\mysnake.c",
|
|
||||||
"applications\\my_func.c",
|
|
||||||
"applications\\mytest.c",
|
|
||||||
"applications\\myproject.c",
|
|
||||||
"applications\\status.c",
|
"applications\\status.c",
|
||||||
|
"applications\\indicator_led.c",
|
||||||
|
"applications\\app_lcd.c",
|
||||||
|
"applications\\mytest.c",
|
||||||
|
"applications\\pin_irq_example.c",
|
||||||
|
"applications\\main.c",
|
||||||
|
"applications\\myproject.c",
|
||||||
|
"applications\\mysnake.c",
|
||||||
|
"applications\\assistant.c",
|
||||||
|
"applications\\icm_20608_sample.c",
|
||||||
|
"applications\\AHT10.c",
|
||||||
"applications\\SConscript"
|
"applications\\SConscript"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -93,9 +93,9 @@
|
|||||||
"name": "AT",
|
"name": "AT",
|
||||||
"path": "rt-thread\\components\\net\\at",
|
"path": "rt-thread\\components\\net\\at",
|
||||||
"files": [
|
"files": [
|
||||||
"rt-thread\\components\\net\\at\\src\\at_utils.c",
|
|
||||||
"rt-thread\\components\\net\\at\\src\\at_client.c",
|
"rt-thread\\components\\net\\at\\src\\at_client.c",
|
||||||
"rt-thread\\components\\net\\at\\src\\at_cli.c",
|
"rt-thread\\components\\net\\at\\src\\at_cli.c",
|
||||||
|
"rt-thread\\components\\net\\at\\src\\at_utils.c",
|
||||||
"rt-thread\\components\\net\\at\\SConscript"
|
"rt-thread\\components\\net\\at\\SConscript"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -214,11 +214,11 @@
|
|||||||
"name": "Fal",
|
"name": "Fal",
|
||||||
"path": "rt-thread\\components\\fal",
|
"path": "rt-thread\\components\\fal",
|
||||||
"files": [
|
"files": [
|
||||||
"rt-thread\\components\\fal\\src\\fal_partition.c",
|
|
||||||
"rt-thread\\components\\fal\\src\\fal_rtt.c",
|
|
||||||
"rt-thread\\components\\fal\\src\\fal_flash.c",
|
|
||||||
"rt-thread\\components\\fal\\src\\fal.c",
|
"rt-thread\\components\\fal\\src\\fal.c",
|
||||||
|
"rt-thread\\components\\fal\\src\\fal_partition.c",
|
||||||
|
"rt-thread\\components\\fal\\src\\fal_flash.c",
|
||||||
"rt-thread\\components\\fal\\samples\\porting\\fal_flash_sfud_port.c",
|
"rt-thread\\components\\fal\\samples\\porting\\fal_flash_sfud_port.c",
|
||||||
|
"rt-thread\\components\\fal\\src\\fal_rtt.c",
|
||||||
"rt-thread\\components\\fal\\SConscript"
|
"rt-thread\\components\\fal\\SConscript"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -242,11 +242,11 @@
|
|||||||
"name": "Finsh",
|
"name": "Finsh",
|
||||||
"path": "rt-thread\\components\\finsh",
|
"path": "rt-thread\\components\\finsh",
|
||||||
"files": [
|
"files": [
|
||||||
"rt-thread\\components\\finsh\\msh_parse.c",
|
|
||||||
"rt-thread\\components\\finsh\\cmd.c",
|
|
||||||
"rt-thread\\components\\finsh\\msh.c",
|
|
||||||
"rt-thread\\components\\finsh\\shell.c",
|
|
||||||
"rt-thread\\components\\finsh\\msh_file.c",
|
"rt-thread\\components\\finsh\\msh_file.c",
|
||||||
|
"rt-thread\\components\\finsh\\msh_parse.c",
|
||||||
|
"rt-thread\\components\\finsh\\msh.c",
|
||||||
|
"rt-thread\\components\\finsh\\cmd.c",
|
||||||
|
"rt-thread\\components\\finsh\\shell.c",
|
||||||
"rt-thread\\components\\finsh\\SConscript"
|
"rt-thread\\components\\finsh\\SConscript"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -270,9 +270,9 @@
|
|||||||
"name": "Infrared_frame",
|
"name": "Infrared_frame",
|
||||||
"path": "packages\\infrared-v0.1.1",
|
"path": "packages\\infrared-v0.1.1",
|
||||||
"files": [
|
"files": [
|
||||||
"packages\\infrared-v0.1.1\\src\\drv_infrared.c",
|
|
||||||
"packages\\infrared-v0.1.1\\src\\infrared.c",
|
|
||||||
"packages\\infrared-v0.1.1\\src\\nec_decoder.c",
|
"packages\\infrared-v0.1.1\\src\\nec_decoder.c",
|
||||||
|
"packages\\infrared-v0.1.1\\src\\infrared.c",
|
||||||
|
"packages\\infrared-v0.1.1\\src\\drv_infrared.c",
|
||||||
"packages\\infrared-v0.1.1\\SConscript"
|
"packages\\infrared-v0.1.1\\SConscript"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -302,11 +302,11 @@
|
|||||||
"name": "kernel-samples",
|
"name": "kernel-samples",
|
||||||
"path": "packages\\kernel_samples-latest\\en",
|
"path": "packages\\kernel_samples-latest\\en",
|
||||||
"files": [
|
"files": [
|
||||||
|
"packages\\kernel_samples-latest\\en\\event_sample.c",
|
||||||
|
"packages\\kernel_samples-latest\\en\\msgq_sample.c",
|
||||||
"packages\\kernel_samples-latest\\en\\mailbox_sample.c",
|
"packages\\kernel_samples-latest\\en\\mailbox_sample.c",
|
||||||
"packages\\kernel_samples-latest\\en\\semaphore_sample.c",
|
"packages\\kernel_samples-latest\\en\\semaphore_sample.c",
|
||||||
"packages\\kernel_samples-latest\\en\\msgq_sample.c",
|
|
||||||
"packages\\kernel_samples-latest\\en\\thread_sample.c",
|
"packages\\kernel_samples-latest\\en\\thread_sample.c",
|
||||||
"packages\\kernel_samples-latest\\en\\event_sample.c",
|
|
||||||
"packages\\kernel_samples-latest\\en\\mutex_sample.c",
|
"packages\\kernel_samples-latest\\en\\mutex_sample.c",
|
||||||
"packages\\kernel_samples-latest\\en\\SConscript"
|
"packages\\kernel_samples-latest\\en\\SConscript"
|
||||||
]
|
]
|
||||||
@ -315,10 +315,10 @@
|
|||||||
"name": "klibc",
|
"name": "klibc",
|
||||||
"path": "rt-thread\\src\\klibc",
|
"path": "rt-thread\\src\\klibc",
|
||||||
"files": [
|
"files": [
|
||||||
"rt-thread\\src\\klibc\\kstdio.c",
|
|
||||||
"rt-thread\\src\\klibc\\rt_vsscanf.c",
|
"rt-thread\\src\\klibc\\rt_vsscanf.c",
|
||||||
"rt-thread\\src\\klibc\\kstring.c",
|
|
||||||
"rt-thread\\src\\klibc\\kerrno.c",
|
"rt-thread\\src\\klibc\\kerrno.c",
|
||||||
|
"rt-thread\\src\\klibc\\kstdio.c",
|
||||||
|
"rt-thread\\src\\klibc\\kstring.c",
|
||||||
"rt-thread\\src\\klibc\\rt_vsnprintf_std.c",
|
"rt-thread\\src\\klibc\\rt_vsnprintf_std.c",
|
||||||
"rt-thread\\src\\klibc\\SConscript"
|
"rt-thread\\src\\klibc\\SConscript"
|
||||||
]
|
]
|
||||||
@ -347,46 +347,46 @@
|
|||||||
"name": "Libraries",
|
"name": "Libraries",
|
||||||
"path": "libraries\\STM32F4xx_HAL",
|
"path": "libraries\\STM32F4xx_HAL",
|
||||||
"files": [
|
"files": [
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_flash_ex.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_usart.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_cryp.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_pccard.c",
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_pccard.c",
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_pcd.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_adc.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_i2c.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_tim_ex.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_cryp_ex.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_tim.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_flash_ramfunc.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_sd.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_i2c_ex.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_ll_sdmmc.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_ll_fmc.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_crc.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_ll_fsmc.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_flash.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_ll_usb.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_adc_ex.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_uart.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_spi.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_pwr.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_rtc.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_rcc_ex.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_qspi.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_lptim.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_pwr_ex.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_cec.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_rtc_ex.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_cortex.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_pcd_ex.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\CMSIS\\Device\\ST\\STM32F4xx\\Source\\Templates\\system_stm32f4xx.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_dma_ex.c",
|
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_sram.c",
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_sram.c",
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_gpio.c",
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_pcd_ex.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_rcc_ex.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_pcd.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_pwr.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_spi.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_ll_fsmc.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_qspi.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_flash_ex.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_tim_ex.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_crc.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal.c",
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_hcd.c",
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_hcd.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_rtc_ex.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_cryp.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_adc.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_sd.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_ll_sdmmc.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_i2c_ex.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_dma_ex.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_adc_ex.c",
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_dma.c",
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_dma.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_cec.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_gpio.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_ll_usb.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_flash.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_uart.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_tim.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_i2c.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_flash_ramfunc.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_ll_fmc.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_cortex.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\CMSIS\\Device\\ST\\STM32F4xx\\Source\\Templates\\system_stm32f4xx.c",
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_rcc.c",
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_rcc.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_lptim.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_cryp_ex.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_rtc.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_pwr_ex.c",
|
||||||
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_usart.c",
|
||||||
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_rng.c",
|
"libraries\\STM32F4xx_HAL\\STM32F4xx_HAL_Driver\\Src\\stm32f4xx_hal_rng.c",
|
||||||
"libraries\\STM32F4xx_HAL\\SConscript"
|
"libraries\\STM32F4xx_HAL\\SConscript"
|
||||||
]
|
]
|
||||||
@ -474,8 +474,8 @@
|
|||||||
"path": "rt-thread\\components\\legacy\\usb\\usbdevice",
|
"path": "rt-thread\\components\\legacy\\usb\\usbdevice",
|
||||||
"files": [
|
"files": [
|
||||||
"rt-thread\\components\\legacy\\usb\\usbdevice\\core\\usbdevice.c",
|
"rt-thread\\components\\legacy\\usb\\usbdevice\\core\\usbdevice.c",
|
||||||
"rt-thread\\components\\legacy\\usb\\usbdevice\\core\\usbdevice_core.c",
|
|
||||||
"rt-thread\\components\\legacy\\usb\\usbdevice\\class\\cdc_vcom.c",
|
"rt-thread\\components\\legacy\\usb\\usbdevice\\class\\cdc_vcom.c",
|
||||||
|
"rt-thread\\components\\legacy\\usb\\usbdevice\\core\\usbdevice_core.c",
|
||||||
"rt-thread\\components\\legacy\\usb\\usbdevice\\SConscript"
|
"rt-thread\\components\\legacy\\usb\\usbdevice\\SConscript"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -488,6 +488,14 @@
|
|||||||
"packages\\rw007-v2.1.0\\SConscript"
|
"packages\\rw007-v2.1.0\\SConscript"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "RyanJson",
|
||||||
|
"path": "packages\\RyanJson-latest",
|
||||||
|
"files": [
|
||||||
|
"packages\\RyanJson-latest\\RyanJson\\RyanJson.c",
|
||||||
|
"packages\\RyanJson-latest\\SConscript"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "SAL",
|
"name": "SAL",
|
||||||
"path": "rt-thread\\components\\net\\netdev",
|
"path": "rt-thread\\components\\net\\netdev",
|
||||||
@ -506,8 +514,8 @@
|
|||||||
"name": "Utilities",
|
"name": "Utilities",
|
||||||
"path": "rt-thread\\components\\utilities\\ulog",
|
"path": "rt-thread\\components\\utilities\\ulog",
|
||||||
"files": [
|
"files": [
|
||||||
"rt-thread\\components\\utilities\\ulog\\ulog.c",
|
|
||||||
"rt-thread\\components\\utilities\\ulog\\backend\\console_be.c",
|
"rt-thread\\components\\utilities\\ulog\\backend\\console_be.c",
|
||||||
|
"rt-thread\\components\\utilities\\ulog\\ulog.c",
|
||||||
"rt-thread\\components\\utilities\\ulog\\SConscript"
|
"rt-thread\\components\\utilities\\ulog\\SConscript"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
11
.vscode/settings.json
vendored
11
.vscode/settings.json
vendored
@ -34,7 +34,16 @@
|
|||||||
"ADC.C": "cpp",
|
"ADC.C": "cpp",
|
||||||
"PM2.5.C": "cpp",
|
"PM2.5.C": "cpp",
|
||||||
"sensor.h": "c",
|
"sensor.h": "c",
|
||||||
"status.h": "c"
|
"status.h": "c",
|
||||||
|
"optional": "c",
|
||||||
|
"ostream": "c",
|
||||||
|
"ratio": "c",
|
||||||
|
"system_error": "c",
|
||||||
|
"array": "c",
|
||||||
|
"functional": "c",
|
||||||
|
"tuple": "c",
|
||||||
|
"type_traits": "c",
|
||||||
|
"utility": "c"
|
||||||
},
|
},
|
||||||
// "cortex-debug.openocdPath": "d:/Develop/"
|
// "cortex-debug.openocdPath": "d:/Develop/"
|
||||||
}
|
}
|
23
README.md
23
README.md
@ -1,14 +1,17 @@
|
|||||||
### 接线
|
### 接线
|
||||||
语音助手
|
#### 语音助手
|
||||||
TX:PD8
|
* TX:PD8 (STM32板子上的,要 RX to TX)
|
||||||
RX:PD9
|
* RX:PD9 (STM32板子上的,要 RX to TX)
|
||||||
ADC传感器
|
#### ADC传感器
|
||||||
PA1 pm25
|
* pm25 PA1
|
||||||
PA5 空气质量
|
* PM2.5 LED PG5
|
||||||
PA6 压力
|
* 空气质量 PA5
|
||||||
风扇
|
* 压力 PA6
|
||||||
PA8
|
#### 风扇
|
||||||
PB2
|
* PA8
|
||||||
|
* PB2
|
||||||
|
#### LED小灯
|
||||||
|
* PE12
|
||||||
|
|
||||||
# 红外遥控贪吃蛇/显示+上传温度等数据
|
# 红外遥控贪吃蛇/显示+上传温度等数据
|
||||||
|
|
||||||
|
@ -54,22 +54,23 @@ static rt_err_t uart_input(rt_device_t dev, rt_size_t size)
|
|||||||
}
|
}
|
||||||
void assist_control(char *rx_buffer)
|
void assist_control(char *rx_buffer)
|
||||||
{
|
{
|
||||||
if (rt_strstr(rx_buffer, "cc")!=RT_NULL)
|
LOG3("assist_control CMD:%s",rx_buffer);
|
||||||
|
if (rt_strstr(rx_buffer, "cc")!=RT_NULL||rt_strstr(rx_buffer, "3")!=RT_NULL)
|
||||||
{
|
{
|
||||||
fan_on();
|
fan_on();
|
||||||
rt_kprintf("加大抽风\n");
|
rt_kprintf("加大抽风\n");
|
||||||
}
|
}
|
||||||
else if (rt_strstr(rx_buffer, "dd")!=RT_NULL)
|
else if (rt_strstr(rx_buffer, "dd")!=RT_NULL||rt_strstr(rx_buffer, "4")!=RT_NULL)
|
||||||
{
|
{
|
||||||
fan_off();
|
fan_off();
|
||||||
rt_kprintf("关闭抽风\n");
|
rt_kprintf("关闭抽风\n");
|
||||||
}
|
}
|
||||||
else if (rt_strstr(rx_buffer, "ee")!=RT_NULL)
|
else if (rt_strstr(rx_buffer, "ee")!=RT_NULL||rt_strstr(rx_buffer, "1")!=RT_NULL)
|
||||||
{
|
{
|
||||||
light_on();
|
light_on();
|
||||||
rt_kprintf("开灯\n");
|
rt_kprintf("开灯\n");
|
||||||
}
|
}
|
||||||
else if (rt_strstr(rx_buffer, "ff")!=RT_NULL)
|
else if (rt_strstr(rx_buffer, "ff")!=RT_NULL||rt_strstr(rx_buffer, "2")!=RT_NULL)
|
||||||
{
|
{
|
||||||
light_off();
|
light_off();
|
||||||
rt_kprintf("关灯\n");
|
rt_kprintf("关灯\n");
|
||||||
@ -93,8 +94,6 @@ static void serial_thread_entry(void *parameter)
|
|||||||
rx_length = rt_device_read(msg.dev, 0, rx_buffer, msg.size);
|
rx_length = rt_device_read(msg.dev, 0, rx_buffer, msg.size);
|
||||||
rx_buffer[rx_length] = '\0';
|
rx_buffer[rx_length] = '\0';
|
||||||
assist_control(rx_buffer);
|
assist_control(rx_buffer);
|
||||||
/* 通过串口设备 serial 输出读取到的消息 */
|
|
||||||
// rt_device_write(serial, 0, rx_buffer, rx_length);
|
|
||||||
/* 打印数据 */
|
/* 打印数据 */
|
||||||
rt_kprintf("%s\n", rx_buffer);
|
rt_kprintf("%s\n", rx_buffer);
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
#include "indicator_led.h"
|
#include "indicator_led.h"
|
||||||
#include "sensor.h"
|
#include "sensor.h"
|
||||||
#include "assistant.h"
|
#include "assistant.h"
|
||||||
|
#include "cJSON.h"
|
||||||
|
#include "RyanJson.h"
|
||||||
#define THREAD_PRIORITY 25
|
#define THREAD_PRIORITY 25
|
||||||
#define THREAD_STACK_SIZE 4096
|
#define THREAD_STACK_SIZE 4096
|
||||||
#define THREAD_TIMESLICE 5
|
#define THREAD_TIMESLICE 5
|
||||||
@ -121,11 +123,13 @@ static void example_message_arrive(void *pcontext, void *pclient, iotx_mqtt_even
|
|||||||
EXAMPLE_TRACE("Payload: %.*s", topic_info->payload_len, topic_info->payload);
|
EXAMPLE_TRACE("Payload: %.*s", topic_info->payload_len, topic_info->payload);
|
||||||
EXAMPLE_TRACE("\n");
|
EXAMPLE_TRACE("\n");
|
||||||
|
|
||||||
// topic_info->payload[strlen(topic_info->payload)] = '\0';
|
|
||||||
char str_tmp[32];
|
char str_tmp[32];
|
||||||
rt_strncpy(str_tmp, topic_info->payload, topic_info->payload_len);
|
|
||||||
str_tmp[topic_info->payload_len] = '\0';
|
RyanJson_t jsonRoot = RyanJsonParse(topic_info->payload);
|
||||||
|
int cmdkey= RyanJsonGetIntValue(RyanJsonGetObjectByKey(jsonRoot, "KEY"));
|
||||||
|
rt_sprintf(str_tmp, "%d", cmdkey);
|
||||||
assist_control(str_tmp);
|
assist_control(str_tmp);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -179,12 +183,12 @@ void show_lcd()
|
|||||||
{
|
{
|
||||||
lcd_y = 10;
|
lcd_y = 10;
|
||||||
easy_show_lcd("Temperature:", Temp);
|
easy_show_lcd("Temperature:", Temp);
|
||||||
// easy_show_lcd("Humidity:", Humi);
|
|
||||||
// easy_show_lcd("Brightness:(lux)", brightness);
|
|
||||||
// easy_show_lcd("Ps data:", (float)ps_data);
|
|
||||||
easy_show_lcd("Air quality:", ADC_air);
|
easy_show_lcd("Air quality:", ADC_air);
|
||||||
easy_show_lcd("PM2.5:", ADC_PM25);
|
easy_show_lcd("PM2.5:", ADC_PM25);
|
||||||
easy_show_lcd("Pressure:",ADC_pressure);
|
easy_show_lcd("Pressure:",ADC_pressure);
|
||||||
|
// easy_show_lcd("Humidity:", Humi);
|
||||||
|
// easy_show_lcd("Brightness:(lux)", brightness);
|
||||||
|
// easy_show_lcd("Ps data:", (float)ps_data);
|
||||||
// lcd_show_string(10, plus_lcd_y(10), 24, "Temperature:");
|
// lcd_show_string(10, plus_lcd_y(10), 24, "Temperature:");
|
||||||
// rt_sprintf(tmp, "%f", Temp);
|
// rt_sprintf(tmp, "%f", Temp);
|
||||||
// lcd_show_string(10, plus_lcd_y(24), 32, tmp);
|
// lcd_show_string(10, plus_lcd_y(24), 32, tmp);
|
||||||
@ -337,18 +341,12 @@ void test_lcd()
|
|||||||
MSH_CMD_EXPORT(test_lcd, run my project);
|
MSH_CMD_EXPORT(test_lcd, run my project);
|
||||||
static int example_publish(void *handle)
|
static int example_publish(void *handle)
|
||||||
{
|
{
|
||||||
|
|
||||||
// tmp_payload();
|
|
||||||
int res = 0;
|
int res = 0;
|
||||||
const char *fmt = "/sys/%s/%s/thing/event/property/post";
|
const char *fmt = "/sys/%s/%s/thing/event/property/post";
|
||||||
// /k1lyriw1yGj/${deviceName}/user/get
|
|
||||||
char *topic = NULL;
|
char *topic = NULL;
|
||||||
int topic_len = 0;
|
int topic_len = 0;
|
||||||
char *payload = tmp;
|
char *payload = tmp;
|
||||||
// strcpy(payload,tmp_payload());
|
|
||||||
// rt_kprintf("payload:%s\n",payload);
|
|
||||||
topic_len = rt_strlen(fmt) + rt_strlen(DEMO_PRODUCT_KEY) + rt_strlen(DEMO_DEVICE_NAME) + 1;
|
topic_len = rt_strlen(fmt) + rt_strlen(DEMO_PRODUCT_KEY) + rt_strlen(DEMO_DEVICE_NAME) + 1;
|
||||||
// topic = HAL_Malloc(topic_len);
|
|
||||||
topic = rt_malloc(topic_len);
|
topic = rt_malloc(topic_len);
|
||||||
if (topic == NULL)
|
if (topic == NULL)
|
||||||
{
|
{
|
||||||
@ -356,14 +354,12 @@ static int example_publish(void *handle)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
memset(topic, 0, topic_len);
|
memset(topic, 0, topic_len);
|
||||||
// HAL_Snprintf(topic, topic_len, fmt, DEMO_PRODUCT_KEY, DEMO_DEVICE_NAME);
|
|
||||||
rt_snprintf(topic, topic_len, fmt, DEMO_PRODUCT_KEY, DEMO_DEVICE_NAME);
|
rt_snprintf(topic, topic_len, fmt, DEMO_PRODUCT_KEY, DEMO_DEVICE_NAME);
|
||||||
|
|
||||||
res = IOT_MQTT_Publish_Simple(0, topic, IOTX_MQTT_QOS0, payload, rt_strlen(payload));
|
res = IOT_MQTT_Publish_Simple(0, topic, IOTX_MQTT_QOS0, payload, rt_strlen(payload));
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
{
|
{
|
||||||
EXAMPLE_TRACE("publish failed, res = %d", res);
|
EXAMPLE_TRACE("publish failed, res = %d", res);
|
||||||
// HAL_Free(topic);
|
|
||||||
rt_free(topic);
|
rt_free(topic);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -410,7 +406,7 @@ static void mqtt_example_main(void *parameter)
|
|||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
if (0 == loop_cnt % 20)
|
if (0 == loop_cnt % 5)
|
||||||
{
|
{
|
||||||
example_publish(pclient);
|
example_publish(pclient);
|
||||||
}
|
}
|
||||||
|
@ -165,11 +165,11 @@ static void sensor_thread(void *parameter)
|
|||||||
ADC_air = MQ2_GetData_PPM(); // 空气质量传感器数值 0-4095 表示从差到优秀
|
ADC_air = MQ2_GetData_PPM(); // 空气质量传感器数值 0-4095 表示从差到优秀
|
||||||
ADC_PM25 = Get_PM25_Average_Data(); // PM2.5传感器数值0-500 表示从优秀到查差
|
ADC_PM25 = Get_PM25_Average_Data(); // PM2.5传感器数值0-500 表示从优秀到查差
|
||||||
ADC_pressure = Pressure_Read(); // 压力传感器数值 0-4095 表示从差到优秀
|
ADC_pressure = Pressure_Read(); // 压力传感器数值 0-4095 表示从差到优秀
|
||||||
LOG5("ADC_air:%f,ADC_PM25:%f,ADC_pressure:%f", ADC_air, ADC_PM25, ADC_pressure);
|
// LOG5("ADC_air:%f,ADC_PM25:%f,ADC_pressure:%f", ADC_air, ADC_PM25, ADC_pressure);
|
||||||
warning_range("air", ADC_air, 0, 4095);
|
warning_range("air", ADC_air, 0, 6.8);
|
||||||
warning_range("PM25", ADC_PM25, 0, 500);
|
warning_range("PM25", ADC_PM25, 0, 260);
|
||||||
warning_range("pressure", ADC_pressure, 0, 4095);
|
warning_range("pressure", ADC_pressure, 3500, 4095);
|
||||||
rt_thread_mdelay(2000);
|
rt_thread_mdelay(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void sensor_init(void)
|
void sensor_init(void)
|
||||||
|
@ -21,22 +21,7 @@
|
|||||||
// #define USE_LOG_D
|
// #define USE_LOG_D
|
||||||
#include "logn.h"
|
#include "logn.h"
|
||||||
|
|
||||||
#define BT_UART_NAME "uart2"
|
#define AT_UART_NAME "uart2"
|
||||||
#define BT_RST_PIN GET_PIN(C, 4)
|
|
||||||
#define BT_LINK_STATUS_PIN GET_PIN(B, 6)
|
|
||||||
#define BT_PIN_LINKED PIN_HIGH
|
|
||||||
#define BT_PIN_UNLINKED PIN_LOW
|
|
||||||
#define BT_AT_LINKED ((rt_atomic_t)1)
|
|
||||||
#define BT_AT_UNLINKED ((rt_atomic_t)0)
|
|
||||||
#define BT_AT_RETRY_TIMES 3
|
|
||||||
#define BT_LINK_TIMEOUT_MS 5000
|
|
||||||
|
|
||||||
#define BT24_SLEEP 0
|
|
||||||
#define BT24_POWER_ON 1
|
|
||||||
#define BT24_AT_READY 2
|
|
||||||
#define BT24_UNLINK 3
|
|
||||||
#define BT24_LINKED 4
|
|
||||||
#define BT24_TRANSPORT 5
|
|
||||||
|
|
||||||
static at_client_t at_client;
|
static at_client_t at_client;
|
||||||
|
|
||||||
@ -66,11 +51,7 @@ rt_err_t sim_call(char *phonenum)
|
|||||||
char at_str[32];
|
char at_str[32];
|
||||||
rt_snprintf(at_str, sizeof(at_str), "ATD%s;", phonenum);
|
rt_snprintf(at_str, sizeof(at_str), "ATD%s;", phonenum);
|
||||||
AT_SEND_CMD(at_str, resp);
|
AT_SEND_CMD(at_str, resp);
|
||||||
at_resp_parse_line_args(resp, 1, "%s", at_str);
|
|
||||||
if(!rt_strcasecmp(at_str, "error"))
|
|
||||||
{
|
|
||||||
LOG_E("Call failed!");
|
|
||||||
}
|
|
||||||
__exit:
|
__exit:
|
||||||
if (resp)
|
if (resp)
|
||||||
{
|
{
|
||||||
@ -143,7 +124,7 @@ rt_err_t sim_dev_init()
|
|||||||
// init cmd lock
|
// init cmd lock
|
||||||
// rt_mutex_init(&cmd_lock, "cmd_lock", RT_IPC_FLAG_FIFO);
|
// rt_mutex_init(&cmd_lock, "cmd_lock", RT_IPC_FLAG_FIFO);
|
||||||
// init at client
|
// init at client
|
||||||
at_client_init(BT_UART_NAME, 128, 128);
|
at_client_init(AT_UART_NAME, 128, 128);
|
||||||
at_client = at_client_get_first();
|
at_client = at_client_get_first();
|
||||||
if (at_client)
|
if (at_client)
|
||||||
{
|
{
|
||||||
|
@ -25,9 +25,9 @@
|
|||||||
#include "logn.h"
|
#include "logn.h"
|
||||||
|
|
||||||
/* 配置 LED 灯引脚 */
|
/* 配置 LED 灯引脚 */
|
||||||
#define PIN_LED_B GET_PIN(F, 11) // PF11 : LED_B --> LED
|
#define PIN_LED_B GET_PIN(E, 12)
|
||||||
#define PIN_LED_R GET_PIN(F, 12) // PF12 : LED_R --> LED
|
#define LED_ON PIN_HIGH
|
||||||
|
#define LED_OFF PIN_LOW
|
||||||
void danger_status(void)
|
void danger_status(void)
|
||||||
{
|
{
|
||||||
char *str = "aa";
|
char *str = "aa";
|
||||||
@ -52,12 +52,12 @@ void light_on(void)
|
|||||||
{
|
{
|
||||||
LOG3("light on!");
|
LOG3("light on!");
|
||||||
rt_pin_mode(PIN_LED_B, PIN_MODE_OUTPUT);
|
rt_pin_mode(PIN_LED_B, PIN_MODE_OUTPUT);
|
||||||
rt_pin_write(PIN_LED_B, PIN_LOW);
|
rt_pin_write(PIN_LED_B, LED_ON);
|
||||||
}
|
}
|
||||||
|
|
||||||
void light_off(void)
|
void light_off(void)
|
||||||
{
|
{
|
||||||
LOG3("light off!");
|
LOG3("light off!");
|
||||||
rt_pin_mode(PIN_LED_B, PIN_MODE_OUTPUT);
|
rt_pin_mode(PIN_LED_B, PIN_MODE_OUTPUT);
|
||||||
rt_pin_write(PIN_LED_B, PIN_HIGH);
|
rt_pin_write(PIN_LED_B, LED_OFF);
|
||||||
}
|
}
|
@ -502,6 +502,9 @@
|
|||||||
|
|
||||||
#define PKG_USING_CJSON
|
#define PKG_USING_CJSON
|
||||||
#define PKG_USING_CJSON_V1717
|
#define PKG_USING_CJSON_V1717
|
||||||
|
#define PKG_USING_RYAN_JSON
|
||||||
|
#define PKG_USING_RYAN_JSON_LATEST_VERSION
|
||||||
|
#define PKG_RYAN_JSON_VER_NUM 0xfff
|
||||||
/* end of JSON: JavaScript Object Notation, a lightweight data-interchange format */
|
/* end of JSON: JavaScript Object Notation, a lightweight data-interchange format */
|
||||||
|
|
||||||
/* XML: Extensible Markup Language */
|
/* XML: Extensible Markup Language */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user