update dataport to 17, heartbeat 15 to comply with sts-o6

This commit is contained in:
Yunhorn 2023-06-05 18:44:58 +08:00
parent 0e9a2decdf
commit ed434f6242
35 changed files with 5074 additions and 1316 deletions

View File

@ -97,22 +97,22 @@ uint32_t MCU_UID(void);
//#define Max_Period 120 //#define Max_Period 120
#define Max_Period 20 #define Max_Period 20
#define Radar_frame_len 36 #define Radar_frame_len 36
#define MajorVer 2U #define MajorVer 23U
#define MinorVer 1U #define MinorVer 06U
#define SubMinorVer 1U #define SubMinorVer 05U
#define senddataport 10U //STS_O1 SEND DATA PORT #define senddataport 17U //STS_O6 SEND DATA PORT
#define sendhtbtport 5U //STS_O2 send heart beat port #define sendhtbtport 5U //STS_O6 send heart beat port
#define cmdreplyport 13U // presence sensor parameter change feedback data port #define cmdreplyport 13U // presence sensor parameter change feedback data port
#define userappctrlport 3U #define userappctrlport 13U
enum Work_Mode { typedef enum {
Network_Mode =0,// Mode = 0, Network/Cloud control mode Network_Mode =0,// Mode = 0, Network/Cloud control mode
Wired_Mode, // Mode = 1, Not used now Wired_Mode, // Mode = 1, Not used now
Reed_Mode, // Mode = 2, Reed Switch Mode or Hall Element Reed_Mode, // Mode = 2, Reed Switch Mode or Hall Element
Radar_Mode, // Mode = 3, USART Radar mode Radar_Mode, // Mode = 3, USART Radar mode
Reed_Radar_Dual_Mode // Mode = 4, Dual Mode of Reed and Radar Reed_Radar_Dual_Mode // Mode = 4, Dual Mode of Reed and Radar
}; } Work_Mode_t;
enum ReedSwitch_Status { enum ReedSwitch_Status {
ReedSwitch_Open = 0, // Door/ReedSwitch/Holl Element Open ReedSwitch_Open = 0, // Door/ReedSwitch/Holl Element Open
@ -129,7 +129,7 @@ enum Presence_Status {
#define ZhanYong 1 #define ZhanYong 1
#define Close 0 #define Close 0
#define Open 1 #define Open 1
/*
enum End_Node_Status { enum End_Node_Status {
Door_Open_No_Presence = 0, //Door Open, No Occupancy Door_Open_No_Presence = 0, //Door Open, No Occupancy
Door_Open_Presence = 1, //Door Open, Occupancy Door_Open_Presence = 1, //Door Open, Occupancy
@ -140,7 +140,7 @@ enum End_Node_Status {
No_Presence = 0, // Not Presence Only, no door status No_Presence = 0, // Not Presence Only, no door status
Presence =1 // Presence Only, no door status Presence =1 // Presence Only, no door status
}; };
*/
enum senddataconfirmation { enum senddataconfirmation {
UnConfirmed = 0, // LoRa unconfirmed data upload UnConfirmed = 0, // LoRa unconfirmed data upload
Confirmed // LoRa Confirmed data upload Confirmed // LoRa Confirmed data upload

View File

@ -80,6 +80,7 @@ void M100C_Send_HeartBeat(uint8_t color,uint8_t Mode); //send to USART1 L
void Node_Send_Data(uint8_t dataport, uint8_t confirm, uint8_t color, uint8_t workmode,uint8_t doorstatus, uint8_t presence_sensor_status); void Node_Send_Data(uint8_t dataport, uint8_t confirm, uint8_t color, uint8_t workmode,uint8_t doorstatus, uint8_t presence_sensor_status);
void Reply_Version_Info(void); void Reply_Version_Info(void);
void Node_Config_LoRa_ADR(uint8_t adr_en);
/* USER CODE END Prototypes */ /* USER CODE END Prototypes */

View File

@ -1,97 +0,0 @@
// <<< Use Configuration Wizard in Context Menu >>>
// <h> Debug MCU Configuration
// <o0.0> DBG_SLEEP
// <i> Debug Sleep Mode
// <i> 0: (FCLK=On, HCLK=Off) FCLK is clocked by the system clock as previously configured by the software while HCLK is disabled
// <i> 1: (FCLK=On, HCLK=On) HCLK is fed by the same clock that is provided to FCLK
// <o0.1> DBG_STOP
// <i> Debug Stop Mode
// <i> 0: (FCLK=Off, HCLK=Off) Clock controller disables all clocks
// <i> 1: (FCLK=On, HCLK=On) FCLK and HCLK are provided by the internal RC oscillator which remains active
// <o0.2> DBG_STANDBY
// <i> Debug Standby Mode
// <i> 0: (FCLK=Off, HCLK=Off) The whole digital part is unpowered.
// <i> 1: (FCLK=On, HCLK=On) Digital part is powered and FCLK and HCLK are provided by the internal RC oscillator which remains active
// <o0.8> DBG_IWDG_STOP
// <i> Debug independent watchdog stopped when core is halted
// <i> 0: The watchdog counter clock continues even if the core is halted
// <i> 1: The watchdog counter clock is stopped when the core is halted
// <o0.9> DBG_WWDG_STOP
// <i> Debug window watchdog stopped when core is halted
// <i> 0: The window watchdog counter clock continues even if the core is halted
// <i> 1: The window watchdog counter clock is stopped when the core is halted
// <o0.10> DBG_TIM1_STOP
// <i> Timer 1 counter stopped when core is halted
// <i> 0: The clock of the involved Timer Counter is fed even if the core is halted
// <i> 1: The clock of the involved Timer counter is stopped when the core is halted
// <o0.11> DBG_TIM2_STOP
// <i> Timer 2 counter stopped when core is halted
// <i> 0: The clock of the involved Timer Counter is fed even if the core is halted
// <i> 1: The clock of the involved Timer counter is stopped when the core is halted
// <o0.12> DBG_TIM3_STOP
// <i> Timer 3 counter stopped when core is halted
// <i> 0: The clock of the involved Timer Counter is fed even if the core is halted
// <i> 1: The clock of the involved Timer counter is stopped when the core is halted
// <o0.13> DBG_TIM4_STOP
// <i> Timer 4 counter stopped when core is halted
// <i> 0: The clock of the involved Timer Counter is fed even if the core is halted
// <i> 1: The clock of the involved Timer counter is stopped when the core is halted
// <o0.14> DBG_CAN1_STOP
// <i> Debug CAN1 stopped when Core is halted
// <i> 0: Same behavior as in normal mode
// <i> 1: CAN1 receive registers are frozen
// <o0.15> DBG_I2C1_SMBUS_TIMEOUT
// <i> I2C1 SMBUS timeout mode stopped when Core is halted
// <i> 0: Same behavior as in normal mode
// <i> 1: The SMBUS timeout is frozen
// <o0.16> DBG_I2C2_SMBUS_TIMEOUT
// <i> I2C2 SMBUS timeout mode stopped when Core is halted
// <i> 0: Same behavior as in normal mode
// <i> 1: The SMBUS timeout is frozen
// <o0.17> DBG_TIM8_STOP
// <i> Timer 8 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.18> DBG_TIM5_STOP
// <i> Timer 5 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.19> DBG_TIM6_STOP
// <i> Timer 6 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.20> DBG_TIM7_STOP
// <i> Timer 7 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.21> DBG_CAN2_STOP
// <i> Debug CAN2 stopped when Core is halted
// <i> 0: Same behavior as in normal mode
// <i> 1: CAN2 receive registers are frozen
// <o0.25> DBG_TIM12_STOP
// <i> Timer 12 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.26> DBG_TIM13_STOP
// <i> Timer 13 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.27> DBG_TIM14_STOP
// <i> Timer 14 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.28> DBG_TIM9_STOP
// <i> Timer 9 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.29> DBG_TIM10_STOP
// <i> Timer 10 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.30> DBG_TIM11_STOP
// <i> Timer 11 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// </h>
DbgMCU_CR = 0x00000007;
// <<< end of configuration section >>>

View File

@ -1,97 +0,0 @@
// <<< Use Configuration Wizard in Context Menu >>>
// <h> Debug MCU Configuration
// <o0.0> DBG_SLEEP
// <i> Debug Sleep Mode
// <i> 0: (FCLK=On, HCLK=Off) FCLK is clocked by the system clock as previously configured by the software while HCLK is disabled
// <i> 1: (FCLK=On, HCLK=On) HCLK is fed by the same clock that is provided to FCLK
// <o0.1> DBG_STOP
// <i> Debug Stop Mode
// <i> 0: (FCLK=Off, HCLK=Off) Clock controller disables all clocks
// <i> 1: (FCLK=On, HCLK=On) FCLK and HCLK are provided by the internal RC oscillator which remains active
// <o0.2> DBG_STANDBY
// <i> Debug Standby Mode
// <i> 0: (FCLK=Off, HCLK=Off) The whole digital part is unpowered.
// <i> 1: (FCLK=On, HCLK=On) Digital part is powered and FCLK and HCLK are provided by the internal RC oscillator which remains active
// <o0.8> DBG_IWDG_STOP
// <i> Debug independent watchdog stopped when core is halted
// <i> 0: The watchdog counter clock continues even if the core is halted
// <i> 1: The watchdog counter clock is stopped when the core is halted
// <o0.9> DBG_WWDG_STOP
// <i> Debug window watchdog stopped when core is halted
// <i> 0: The window watchdog counter clock continues even if the core is halted
// <i> 1: The window watchdog counter clock is stopped when the core is halted
// <o0.10> DBG_TIM1_STOP
// <i> Timer 1 counter stopped when core is halted
// <i> 0: The clock of the involved Timer Counter is fed even if the core is halted
// <i> 1: The clock of the involved Timer counter is stopped when the core is halted
// <o0.11> DBG_TIM2_STOP
// <i> Timer 2 counter stopped when core is halted
// <i> 0: The clock of the involved Timer Counter is fed even if the core is halted
// <i> 1: The clock of the involved Timer counter is stopped when the core is halted
// <o0.12> DBG_TIM3_STOP
// <i> Timer 3 counter stopped when core is halted
// <i> 0: The clock of the involved Timer Counter is fed even if the core is halted
// <i> 1: The clock of the involved Timer counter is stopped when the core is halted
// <o0.13> DBG_TIM4_STOP
// <i> Timer 4 counter stopped when core is halted
// <i> 0: The clock of the involved Timer Counter is fed even if the core is halted
// <i> 1: The clock of the involved Timer counter is stopped when the core is halted
// <o0.14> DBG_CAN1_STOP
// <i> Debug CAN1 stopped when Core is halted
// <i> 0: Same behavior as in normal mode
// <i> 1: CAN1 receive registers are frozen
// <o0.15> DBG_I2C1_SMBUS_TIMEOUT
// <i> I2C1 SMBUS timeout mode stopped when Core is halted
// <i> 0: Same behavior as in normal mode
// <i> 1: The SMBUS timeout is frozen
// <o0.16> DBG_I2C2_SMBUS_TIMEOUT
// <i> I2C2 SMBUS timeout mode stopped when Core is halted
// <i> 0: Same behavior as in normal mode
// <i> 1: The SMBUS timeout is frozen
// <o0.17> DBG_TIM8_STOP
// <i> Timer 8 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.18> DBG_TIM5_STOP
// <i> Timer 5 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.19> DBG_TIM6_STOP
// <i> Timer 6 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.20> DBG_TIM7_STOP
// <i> Timer 7 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.21> DBG_CAN2_STOP
// <i> Debug CAN2 stopped when Core is halted
// <i> 0: Same behavior as in normal mode
// <i> 1: CAN2 receive registers are frozen
// <o0.25> DBG_TIM12_STOP
// <i> Timer 12 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.26> DBG_TIM13_STOP
// <i> Timer 13 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.27> DBG_TIM14_STOP
// <i> Timer 14 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.28> DBG_TIM9_STOP
// <i> Timer 9 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.29> DBG_TIM10_STOP
// <i> Timer 10 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// <o0.30> DBG_TIM11_STOP
// <i> Timer 11 counter stopped when core is halted
// <i> 0: The clock of the involved timer counter is fed even if the core is halted, and the outputs behave normally.
// <i> 1: The clock of the involved timer counter is stopped when the core is halted, and the outputs are disabled (as if there were an emergency stop in response to a break event).
// </h>
DbgMCU_CR = 0x00000007;
// <<< end of configuration section >>>

File diff suppressed because one or more lines are too long

View File

@ -26,7 +26,7 @@
<ToolsetNumber>0x4</ToolsetNumber> <ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName> <ToolsetName>ARM-ADS</ToolsetName>
<TargetOption> <TargetOption>
<CLKADS>12000000</CLKADS> <CLKADS>80000000</CLKADS>
<OPTTT> <OPTTT>
<gFlags>1</gFlags> <gFlags>1</gFlags>
<BeepAtEnd>1</BeepAtEnd> <BeepAtEnd>1</BeepAtEnd>
@ -125,7 +125,7 @@
<SetRegEntry> <SetRegEntry>
<Number>0</Number> <Number>0</Number>
<Key>ST-LINKIII-KEIL_SWO</Key> <Key>ST-LINKIII-KEIL_SWO</Key>
<Name>-U34FF6B063446393130411457 -I0 -O206 -S1 -C0 -A0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32F103C8$Flash\STM32F10x_128.FLM)</Name> <Name>-U48FF76067567515339490381 -O206 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(1BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO31 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32F103C8$Flash\STM32F10x_128.FLM)</Name>
</SetRegEntry> </SetRegEntry>
<SetRegEntry> <SetRegEntry>
<Number>0</Number> <Number>0</Number>
@ -536,7 +536,7 @@
<Group> <Group>
<GroupName>Application/MDK-ARM</GroupName> <GroupName>Application/MDK-ARM</GroupName>
<tvExp>0</tvExp> <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel> <cbSel>0</cbSel>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>
@ -660,7 +660,7 @@
<Group> <Group>
<GroupName>Drivers/STM32F1xx_HAL_Driver</GroupName> <GroupName>Drivers/STM32F1xx_HAL_Driver</GroupName>
<tvExp>1</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel> <cbSel>0</cbSel>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>

View File

@ -49,12 +49,12 @@
<InvalidFlash>1</InvalidFlash> <InvalidFlash>1</InvalidFlash>
</TargetStatus> </TargetStatus>
<OutputDirectory>LED_M100C_WS2812\</OutputDirectory> <OutputDirectory>LED_M100C_WS2812\</OutputDirectory>
<OutputName>LED_M100C_WS2812</OutputName> <OutputName>STS_OO_F103_O6_23R0605</OutputName>
<CreateExecutable>1</CreateExecutable> <CreateExecutable>1</CreateExecutable>
<CreateLib>0</CreateLib> <CreateLib>0</CreateLib>
<CreateHexFile>1</CreateHexFile> <CreateHexFile>1</CreateHexFile>
<DebugInformation>1</DebugInformation> <DebugInformation>0</DebugInformation>
<BrowseInformation>1</BrowseInformation> <BrowseInformation>0</BrowseInformation>
<ListingPath></ListingPath> <ListingPath></ListingPath>
<HexFormatSelection>1</HexFormatSelection> <HexFormatSelection>1</HexFormatSelection>
<Merge32K>0</Merge32K> <Merge32K>0</Merge32K>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -22,41 +22,41 @@ Dialog DLL: TCM.DLL V1.48.0.0
<h2>Project:</h2> <h2>Project:</h2>
D:\ONEDRIVE\GIT\STS_IOT\STS_OO\MDK-ARM\LED_M100C_WS2812.uvprojx D:\ONEDRIVE\GIT\STS_IOT\STS_OO\MDK-ARM\LED_M100C_WS2812.uvprojx
Project File Date: 04/11/2022 Project File Date: 02/21/2023
<h2>Output:</h2> <h2>Output:</h2>
*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\Keil_v5\ARM\ARMCC\Bin' *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\Keil_v5\ARM\ARMCC\Bin'
Rebuild target 'LED_M100C_WS2812' Rebuild target 'LED_M100C_WS2812'
assembling startup_stm32f103xb.s... assembling startup_stm32f103xb.s...
compiling stm32f1xx_ll_exti.c...
compiling stm32f1xx_ll_gpio.c...
compiling stm32f1xx_ll_dma.c...
compiling stm32f1xx_ll_pwr.c...
compiling stm32f1xx_ll_utils.c...
compiling stm32f1xx_ll_usart.c...
compiling stm32f1xx_ll_rcc.c...
compiling stm32f1xx_ll_tim.c...
compiling system_stm32f1xx.c...
compiling dma.c...
compiling iwdg.c...
compiling main.c... compiling main.c...
compiling usart.c...
compiling gpio.c... compiling gpio.c...
compiling stm32f1xx_ll_exti.c...
compiling stm32f1xx_it.c... compiling stm32f1xx_it.c...
compiling dma.c...
compiling stm32f1xx_ll_pwr.c...
compiling stm32f1xx_ll_tim.c...
compiling iwdg.c...
compiling stm32f1xx_ll_gpio.c...
compiling stm32f1xx_ll_utils.c...
compiling stm32f1xx_ll_rcc.c...
compiling stm32f1xx_ll_dma.c...
compiling sys.c... compiling sys.c...
compiling stm32f1xx_ll_usart.c...
compiling usart.c...
compiling tim.c... compiling tim.c...
compiling system_stm32f1xx.c...
linking... linking...
Program Size: Code=11132 RO-data=428 RW-data=224 ZI-data=1344 Program Size: Code=11244 RO-data=428 RW-data=224 ZI-data=1344
FromELF: creating hex file... FromELF: creating hex file...
"LED_M100C_WS2812\LED_M100C_WS2812.axf" - 0 Error(s), 0 Warning(s). "LED_M100C_WS2812\STS_OO_F103_O1O2O3O5O6_V2_2023.axf" - 0 Error(s), 0 Warning(s).
<h2>Software Packages used:</h2> <h2>Software Packages used:</h2>
Package Vendor: ARM Package Vendor: ARM
http://www.keil.com/pack/ARM.CMSIS.5.7.0.pack http://www.keil.com/pack/ARM.CMSIS.5.9.0.pack
ARM.CMSIS.5.7.0 ARM.CMSIS.5.9.0
CMSIS (Cortex Microcontroller Software Interface Standard) CMSIS (Common Microcontroller Software Interface Standard)
* Component: CORE Version: 5.4.0 * Component: CORE Version: 5.6.0
Package Vendor: Keil Package Vendor: Keil
http://www.keil.com/pack/Keil.STM32F1xx_DFP.2.3.0.pack http://www.keil.com/pack/Keil.STM32F1xx_DFP.2.3.0.pack
@ -65,13 +65,13 @@ Package Vendor: Keil
<h2>Collection of Component include folders:</h2> <h2>Collection of Component include folders:</h2>
.\RTE\_LED_M100C_WS2812 .\RTE\_LED_M100C_WS2812
D:\Users\lenovo\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include D:\Users\lenovo\AppData\Local\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
D:\Users\lenovo\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include D:\Users\lenovo\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
<h2>Collection of Component Files used:</h2> <h2>Collection of Component Files used:</h2>
* Component: ARM::CMSIS:CORE:5.4.0 * Component: ARM::CMSIS:CORE:5.6.0
Build Time Elapsed: 00:00:03 Build Time Elapsed: 00:00:02
</pre> </pre>
</body> </body>
</html> </html>

View File

@ -0,0 +1,16 @@
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
LR_IROM1 0x08000000 0x00010000 { ; load region size_region
ER_IROM1 0x08000000 0x00010000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}
RW_IRAM1 0x20000000 0x00005000 { ; RW data
.ANY (+RW +ZI)
}
}

View File

@ -0,0 +1,77 @@
<html>
<body>
<pre>
<h1>µVision Build Log</h1>
<h2>Tool Versions:</h2>
IDE-Version: ¦ÌVision V5.33.0.0
Copyright (C) 2020 ARM Ltd and ARM Germany GmbH. All rights reserved.
License Information: dp lenovo, yunhorn, LIC=NQQMA-19ZCY-KP3ZY-IMEF3-G09Q9-GVNGQ
Tool Versions:
Toolchain: MDK-ARM Plus Version: 5.33.0.0
Toolchain Path: D:\Keil_v5\ARM\ARMCC\Bin
C Compiler: Armcc.exe V5.06 update 7 (build 960)
Assembler: Armasm.exe V5.06 update 7 (build 960)
Linker/Locator: ArmLink.exe V5.06 update 7 (build 960)
Library Manager: ArmAr.exe V5.06 update 7 (build 960)
Hex Converter: FromElf.exe V5.06 update 7 (build 960)
CPU DLL: SARMCM3.DLL V5.33.0.0
Dialog DLL: DCM.DLL V1.17.3.0
Target DLL: STLink\ST-LINKIII-KEIL_SWO.dll V3.0.8.0
Dialog DLL: TCM.DLL V1.48.0.0
<h2>Project:</h2>
D:\ONEDRIVE\GIT\STS_IOT\STS_OO_V230530\STS_OO\MDK-ARM\LED_M100C_WS2812.uvprojx
Project File Date: 06/02/2023
<h2>Output:</h2>
*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\Keil_v5\ARM\ARMCC\Bin'
Rebuild target 'LED_M100C_WS2812'
assembling startup_stm32f103xb.s...
compiling stm32f1xx_ll_rcc.c...
compiling stm32f1xx_ll_dma.c...
compiling stm32f1xx_ll_pwr.c...
compiling stm32f1xx_ll_gpio.c...
compiling stm32f1xx_ll_exti.c...
compiling stm32f1xx_ll_utils.c...
compiling stm32f1xx_ll_tim.c...
compiling stm32f1xx_ll_usart.c...
compiling system_stm32f1xx.c...
compiling dma.c...
compiling sys.c...
compiling iwdg.c...
compiling tim.c...
compiling main.c...
compiling gpio.c...
compiling stm32f1xx_it.c...
compiling usart.c...
linking...
Program Size: Code=11296 RO-data=428 RW-data=224 ZI-data=1408
FromELF: creating hex file...
"LED_M100C_WS2812\STS_OO_F103_O1O2O3O5O6_V2_2023R0530.axf" - 0 Error(s), 0 Warning(s).
<h2>Software Packages used:</h2>
Package Vendor: ARM
http://www.keil.com/pack/ARM.CMSIS.5.9.0.pack
ARM.CMSIS.5.9.0
CMSIS (Common Microcontroller Software Interface Standard)
* Component: CORE Version: 5.6.0
Package Vendor: Keil
http://www.keil.com/pack/Keil.STM32F1xx_DFP.2.3.0.pack
Keil.STM32F1xx_DFP.2.3.0
STMicroelectronics STM32F1 Series Device Support, Drivers and Examples
<h2>Collection of Component include folders:</h2>
.\RTE\_LED_M100C_WS2812
D:\Users\lenovo\AppData\Local\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
D:\Users\lenovo\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
<h2>Collection of Component Files used:</h2>
* Component: ARM::CMSIS:CORE:5.6.0
Build Time Elapsed: 00:00:03
</pre>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
--cpu Cortex-M3
"led_m100c_ws2812\startup_stm32f103xb.o"
"led_m100c_ws2812\main.o"
"led_m100c_ws2812\gpio.o"
"led_m100c_ws2812\dma.o"
"led_m100c_ws2812\iwdg.o"
"led_m100c_ws2812\tim.o"
"led_m100c_ws2812\usart.o"
"led_m100c_ws2812\stm32f1xx_it.o"
"led_m100c_ws2812\sys.o"
"led_m100c_ws2812\stm32f1xx_ll_gpio.o"
"led_m100c_ws2812\stm32f1xx_ll_dma.o"
"led_m100c_ws2812\stm32f1xx_ll_rcc.o"
"led_m100c_ws2812\stm32f1xx_ll_utils.o"
"led_m100c_ws2812\stm32f1xx_ll_exti.o"
"led_m100c_ws2812\stm32f1xx_ll_pwr.o"
"led_m100c_ws2812\stm32f1xx_ll_tim.o"
"led_m100c_ws2812\stm32f1xx_ll_usart.o"
"led_m100c_ws2812\system_stm32f1xx.o"
--library_type=microlib --strict --scatter "LED_M100C_WS2812\STS_OO_F103_O1O2O3O5O6_V2_2023R0530.sct"
--summary_stderr --info summarysizes --map --load_addr_map_info --xref --callgraph --symbols
--info sizes --info totals --info unused --info veneers
--list "STS_OO_F103_O1O2O3O5O6_V2_2023R0530.map" -o LED_M100C_WS2812\STS_OO_F103_O1O2O3O5O6_V2_2023R0530.axf

View File

@ -0,0 +1,16 @@
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
LR_IROM1 0x08000000 0x00010000 { ; load region size_region
ER_IROM1 0x08000000 0x00010000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}
RW_IRAM1 0x20000000 0x00005000 { ; RW data
.ANY (+RW +ZI)
}
}

View File

@ -0,0 +1,77 @@
<html>
<body>
<pre>
<h1>µVision Build Log</h1>
<h2>Tool Versions:</h2>
IDE-Version: ¦ÌVision V5.33.0.0
Copyright (C) 2020 ARM Ltd and ARM Germany GmbH. All rights reserved.
License Information: dp lenovo, yunhorn, LIC=NQQMA-19ZCY-KP3ZY-IMEF3-G09Q9-GVNGQ
Tool Versions:
Toolchain: MDK-ARM Plus Version: 5.33.0.0
Toolchain Path: D:\Keil_v5\ARM\ARMCC\Bin
C Compiler: Armcc.exe V5.06 update 7 (build 960)
Assembler: Armasm.exe V5.06 update 7 (build 960)
Linker/Locator: ArmLink.exe V5.06 update 7 (build 960)
Library Manager: ArmAr.exe V5.06 update 7 (build 960)
Hex Converter: FromElf.exe V5.06 update 7 (build 960)
CPU DLL: SARMCM3.DLL V5.33.0.0
Dialog DLL: DCM.DLL V1.17.3.0
Target DLL: STLink\ST-LINKIII-KEIL_SWO.dll V3.0.8.0
Dialog DLL: TCM.DLL V1.48.0.0
<h2>Project:</h2>
D:\ONEDRIVE\GIT\STS_IOT\STS_OO_V230530\STS_OO\MDK-ARM\LED_M100C_WS2812.uvprojx
Project File Date: 06/05/2023
<h2>Output:</h2>
*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\Keil_v5\ARM\ARMCC\Bin'
Rebuild target 'LED_M100C_WS2812'
assembling startup_stm32f103xb.s...
compiling dma.c...
compiling stm32f1xx_ll_gpio.c...
compiling stm32f1xx_it.c...
compiling gpio.c...
compiling stm32f1xx_ll_utils.c...
compiling tim.c...
compiling stm32f1xx_ll_exti.c...
compiling stm32f1xx_ll_rcc.c...
compiling stm32f1xx_ll_pwr.c...
compiling stm32f1xx_ll_dma.c...
compiling stm32f1xx_ll_usart.c...
compiling stm32f1xx_ll_tim.c...
compiling sys.c...
compiling iwdg.c...
compiling system_stm32f1xx.c...
compiling main.c...
compiling usart.c...
linking...
Program Size: Code=11296 RO-data=428 RW-data=224 ZI-data=1408
FromELF: creating hex file...
"LED_M100C_WS2812\STS_OO_F103_O6_23R0602.axf" - 0 Error(s), 0 Warning(s).
<h2>Software Packages used:</h2>
Package Vendor: ARM
http://www.keil.com/pack/ARM.CMSIS.5.9.0.pack
ARM.CMSIS.5.9.0
CMSIS (Common Microcontroller Software Interface Standard)
* Component: CORE Version: 5.6.0
Package Vendor: Keil
http://www.keil.com/pack/Keil.STM32F1xx_DFP.2.3.0.pack
Keil.STM32F1xx_DFP.2.3.0
STMicroelectronics STM32F1 Series Device Support, Drivers and Examples
<h2>Collection of Component include folders:</h2>
.\RTE\_LED_M100C_WS2812
D:\Users\lenovo\AppData\Local\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
D:\Users\lenovo\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
<h2>Collection of Component Files used:</h2>
* Component: ARM::CMSIS:CORE:5.6.0
Build Time Elapsed: 00:00:01
</pre>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
--cpu Cortex-M3
"led_m100c_ws2812\startup_stm32f103xb.o"
"led_m100c_ws2812\main.o"
"led_m100c_ws2812\gpio.o"
"led_m100c_ws2812\dma.o"
"led_m100c_ws2812\iwdg.o"
"led_m100c_ws2812\tim.o"
"led_m100c_ws2812\usart.o"
"led_m100c_ws2812\stm32f1xx_it.o"
"led_m100c_ws2812\sys.o"
"led_m100c_ws2812\stm32f1xx_ll_gpio.o"
"led_m100c_ws2812\stm32f1xx_ll_dma.o"
"led_m100c_ws2812\stm32f1xx_ll_rcc.o"
"led_m100c_ws2812\stm32f1xx_ll_utils.o"
"led_m100c_ws2812\stm32f1xx_ll_exti.o"
"led_m100c_ws2812\stm32f1xx_ll_pwr.o"
"led_m100c_ws2812\stm32f1xx_ll_tim.o"
"led_m100c_ws2812\stm32f1xx_ll_usart.o"
"led_m100c_ws2812\system_stm32f1xx.o"
--library_type=microlib --nodebug --strict --scatter "LED_M100C_WS2812\STS_OO_F103_O6_23R0602.sct"
--summary_stderr --info summarysizes --map --load_addr_map_info --xref --callgraph --symbols
--info sizes --info totals --info unused --info veneers
--list "STS_OO_F103_O6_23R0602.map" -o LED_M100C_WS2812\STS_OO_F103_O6_23R0602.axf

View File

@ -0,0 +1,16 @@
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
LR_IROM1 0x08000000 0x00010000 { ; load region size_region
ER_IROM1 0x08000000 0x00010000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}
RW_IRAM1 0x20000000 0x00005000 { ; RW data
.ANY (+RW +ZI)
}
}

View File

@ -0,0 +1,77 @@
<html>
<body>
<pre>
<h1>µVision Build Log</h1>
<h2>Tool Versions:</h2>
IDE-Version: ¦ÌVision V5.33.0.0
Copyright (C) 2020 ARM Ltd and ARM Germany GmbH. All rights reserved.
License Information: dp lenovo, yunhorn, LIC=NQQMA-19ZCY-KP3ZY-IMEF3-G09Q9-GVNGQ
Tool Versions:
Toolchain: MDK-ARM Plus Version: 5.33.0.0
Toolchain Path: D:\Keil_v5\ARM\ARMCC\Bin
C Compiler: Armcc.exe V5.06 update 7 (build 960)
Assembler: Armasm.exe V5.06 update 7 (build 960)
Linker/Locator: ArmLink.exe V5.06 update 7 (build 960)
Library Manager: ArmAr.exe V5.06 update 7 (build 960)
Hex Converter: FromElf.exe V5.06 update 7 (build 960)
CPU DLL: SARMCM3.DLL V5.33.0.0
Dialog DLL: DCM.DLL V1.17.3.0
Target DLL: STLink\ST-LINKIII-KEIL_SWO.dll V3.0.8.0
Dialog DLL: TCM.DLL V1.48.0.0
<h2>Project:</h2>
D:\ONEDRIVE\GIT\STS_IOT\STS_OO_V230605\STS_OO\MDK-ARM\LED_M100C_WS2812.uvprojx
Project File Date: 06/05/2023
<h2>Output:</h2>
*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\Keil_v5\ARM\ARMCC\Bin'
Rebuild target 'LED_M100C_WS2812'
assembling startup_stm32f103xb.s...
compiling usart.c...
compiling stm32f1xx_ll_dma.c...
compiling stm32f1xx_ll_utils.c...
compiling dma.c...
compiling stm32f1xx_ll_gpio.c...
compiling stm32f1xx_ll_pwr.c...
compiling stm32f1xx_ll_exti.c...
compiling gpio.c...
compiling stm32f1xx_ll_rcc.c...
compiling stm32f1xx_ll_usart.c...
compiling sys.c...
compiling system_stm32f1xx.c...
compiling stm32f1xx_ll_tim.c...
compiling main.c...
compiling iwdg.c...
compiling stm32f1xx_it.c...
compiling tim.c...
linking...
Program Size: Code=11244 RO-data=428 RW-data=224 ZI-data=1408
FromELF: creating hex file...
"LED_M100C_WS2812\STS_OO_F103_O6_23R0605.axf" - 0 Error(s), 0 Warning(s).
<h2>Software Packages used:</h2>
Package Vendor: ARM
http://www.keil.com/pack/ARM.CMSIS.5.9.0.pack
ARM.CMSIS.5.9.0
CMSIS (Common Microcontroller Software Interface Standard)
* Component: CORE Version: 5.6.0
Package Vendor: Keil
http://www.keil.com/pack/Keil.STM32F1xx_DFP.2.3.0.pack
Keil.STM32F1xx_DFP.2.3.0
STMicroelectronics STM32F1 Series Device Support, Drivers and Examples
<h2>Collection of Component include folders:</h2>
.\RTE\_LED_M100C_WS2812
D:\Users\lenovo\AppData\Local\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\Core\Include
D:\Users\lenovo\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
<h2>Collection of Component Files used:</h2>
* Component: ARM::CMSIS:CORE:5.6.0
Build Time Elapsed: 00:00:01
</pre>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
--cpu Cortex-M3
"led_m100c_ws2812\startup_stm32f103xb.o"
"led_m100c_ws2812\main.o"
"led_m100c_ws2812\gpio.o"
"led_m100c_ws2812\dma.o"
"led_m100c_ws2812\iwdg.o"
"led_m100c_ws2812\tim.o"
"led_m100c_ws2812\usart.o"
"led_m100c_ws2812\stm32f1xx_it.o"
"led_m100c_ws2812\sys.o"
"led_m100c_ws2812\stm32f1xx_ll_gpio.o"
"led_m100c_ws2812\stm32f1xx_ll_dma.o"
"led_m100c_ws2812\stm32f1xx_ll_rcc.o"
"led_m100c_ws2812\stm32f1xx_ll_utils.o"
"led_m100c_ws2812\stm32f1xx_ll_exti.o"
"led_m100c_ws2812\stm32f1xx_ll_pwr.o"
"led_m100c_ws2812\stm32f1xx_ll_tim.o"
"led_m100c_ws2812\stm32f1xx_ll_usart.o"
"led_m100c_ws2812\system_stm32f1xx.o"
--library_type=microlib --nodebug --strict --scatter "LED_M100C_WS2812\STS_OO_F103_O6_23R0605.sct"
--summary_stderr --info summarysizes --map --load_addr_map_info --xref --callgraph --symbols
--info sizes --info totals --info unused --info veneers
--list "STS_OO_F103_O6_23R0605.map" -o LED_M100C_WS2812\STS_OO_F103_O6_23R0605.axf

View File

@ -0,0 +1,16 @@
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
LR_IROM1 0x08000000 0x00010000 { ; load region size_region
ER_IROM1 0x08000000 0x00010000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}
RW_IRAM1 0x20000000 0x00005000 { ; RW data
.ANY (+RW +ZI)
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -461,14 +461,14 @@ ARM Macro Assembler Page 8
00000000 00000000
00000000 00000000
Command Line: --debug --xref --diag_suppress=9931 --cpu=Cortex-M3 --apcs=interw Command Line: --xref --diag_suppress=9931 --cpu=Cortex-M3 --apcs=interwork --de
ork --depend=led_m100c_ws2812\startup_stm32f103xb.d -oled_m100c_ws2812\startup_ pend=led_m100c_ws2812\startup_stm32f103xb.d -oled_m100c_ws2812\startup_stm32f10
stm32f103xb.o -I.\RTE\_LED_M100C_WS2812 -ID:\Users\lenovo\AppData\Local\Arm\Pac 3xb.o -I.\RTE\_LED_M100C_WS2812 -ID:\Users\lenovo\AppData\Local\Arm\Packs\ARM\C
ks\ARM\CMSIS\5.7.0\CMSIS\Core\Include -ID:\Users\lenovo\AppData\Local\Arm\Packs MSIS\5.9.0\CMSIS\Core\Include -ID:\Users\lenovo\AppData\Local\Arm\Packs\Keil\ST
\Keil\STM32F1xx_DFP\2.3.0\Device\Include --predefine="__MICROLIB SETA 1" --pred M32F1xx_DFP\2.3.0\Device\Include --predefine="__MICROLIB SETA 1" --predefine="_
efine="__UVISION_VERSION SETA 533" --predefine="_RTE_ SETA 1" --predefine="STM3 _UVISION_VERSION SETA 533" --predefine="_RTE_ SETA 1" --predefine="STM32F10X_MD
2F10X_MD SETA 1" --predefine="_RTE_ SETA 1" --list=startup_stm32f103xb.lst star SETA 1" --predefine="_RTE_ SETA 1" --list=startup_stm32f103xb.lst startup_stm3
tup_stm32f103xb.s 2f103xb.s

View File

@ -1,3 +1,7 @@
# STS_OO # STS_OO
STS_OO occupancy sensor STS_OO occupancy sensor
2023-02-21 ADD lora-wan ADR_EN
2023-02-21 main.c line 134, change Heart_Beat_Period = Minimum_Period + (MCU_UID()%60);
// STS_O1 For Radar 2023-02-21 SUNDP

View File

@ -131,15 +131,15 @@ int main(void)
//LL_mDelay(500); //LL_mDelay(500);
LL_mDelay(500); LL_mDelay(500);
//Heart_Beat_Period = Minimum_Period + (MCU_UID()%60); Heart_Beat_Period = Minimum_Period + (MCU_UID()%60); // STS_O1 For Radar 2023-02-21 SUNDP
Heart_Beat_Period = Max_Period; // STS_O1 For Radar ******************* //Heart_Beat_Period = Max_Period; // STS_O1 For Radar *******************
/* USER CODE END 2 */ /* USER CODE END 2 */
/* Infinite loop */ /* Infinite loop */
/* USER CODE BEGIN WHILE */ /* USER CODE BEGIN WHILE */
/* send firmware version ### 2022-09-22 for version control */ /* send firmware version ### 2022-09-22 for version control */
Node_Config_LoRa_ADR(1); //enable LORA-WAN ADR
while (1) while (1)
{ {
@ -235,13 +235,13 @@ int main(void)
if ((Occupancy_Status == 0) && (Door_Status) ) if ((Occupancy_Status == 0) && (Door_Status) )
{ {
puColor = 1; // green puColor = 1; // green
Node_Send_Data(sendhtbtport,UnConfirmed, puColor, Work_Mode, Door_Status, Occupancy_Status); Node_Send_Data(sendhtbtport,UnConfirmed, puColor, Work_Mode, KeYong, Occupancy_Status);
} else } else
if ((Occupancy_Status == 1) || (Door_Status == 0)) if ((Occupancy_Status == 1) || (Door_Status == 0))
{ {
puColor = 2; // red puColor = 2; // red
Node_Send_Data(sendhtbtport,UnConfirmed, puColor, Work_Mode, Door_Status, Occupancy_Status); Node_Send_Data(sendhtbtport,UnConfirmed, puColor, Work_Mode, ZhanYong, Occupancy_Status);
} }
@ -339,13 +339,13 @@ void Reed_Working(void)
WS2812_Light_Custom( 0,Light_Level,0 ); WS2812_Light_Custom( 0,Light_Level,0 );
puColor = Green; // Green puColor = Green; // Green
// M100C_Send_Data(4,0,KeYong); // M100C_Send_Data(4,0,KeYong);
Node_Send_Data(senddataport,UnConfirmed, Green, Work_Mode, Door_Status, No_Occupancy); Node_Send_Data(senddataport,UnConfirmed, Green, Work_Mode, KeYong, No_Occupancy);
} }
else{ else{
WS2812_Light_Custom( Light_Level,0,0 ); WS2812_Light_Custom( Light_Level,0,0 );
puColor = Red; // Red puColor = Red; // Red
// M100C_Send_Data(4,0,ZhanYong); // M100C_Send_Data(4,0,ZhanYong);
Node_Send_Data(senddataport,UnConfirmed, Red, Work_Mode, Door_Status, Occupancy); Node_Send_Data(senddataport,UnConfirmed, Red, Work_Mode, ZhanYong, Occupancy);
} }
} }

View File

@ -23,6 +23,7 @@
#include "gpio.h" #include "gpio.h"
/* USER CODE BEGIN 0 */ /* USER CODE BEGIN 0 */
extern volatile uint8_t Joined_Mode;
extern volatile uint8_t Work_Mode; extern volatile uint8_t Work_Mode;
extern volatile uint8_t Radar_Data_Flag; // STS_O1 For Radar extern volatile uint8_t Radar_Data_Flag; // STS_O1 For Radar
extern volatile uint8_t Occupancy_Status; extern volatile uint8_t Occupancy_Status;
@ -32,7 +33,8 @@ uint8_t USART1_RX_Buffer[max_size] = {0} ; // LoRaWAN USART1
uint8_t USART3_RX_Buffer[Radar_frame_len] = {0} ; // STS_O1 For Radar for Radar frame uint8_t USART3_RX_Buffer[Radar_frame_len] = {0} ; // STS_O1 For Radar for Radar frame
volatile uint16_t Buffer_INDEX = 0; volatile uint16_t Buffer_INDEX = 0;
volatile uint16_t Previous_INDEX = 0; volatile uint16_t Previous_INDEX = 0;
void UsartxSendDataStr(USART_TypeDef* USARTx,uint8_t *Data,uint32_t len);
char sendBuffer[64];
_Bool Motion_Flag; // STS_O1 For Radar motion detection _Bool Motion_Flag; // STS_O1 For Radar motion detection
@ -209,6 +211,8 @@ uint8_t Check_Status(void)
} }
Accept_Finished_Flag = 0; Accept_Finished_Flag = 0;
//Node_Config_LoRa_ADR(1); //enable LORA-WAN ADR
if(strncmp(buffer, (char*)(USART1_RX_Buffer),11) == 0){ if(strncmp(buffer, (char*)(USART1_RX_Buffer),11) == 0){
value = 1; value = 1;
LL_TIM_EnableIT_UPDATE(TIM3); LL_TIM_EnableIT_UPDATE(TIM3);
@ -248,6 +252,8 @@ void Online_Data_Analysis(volatile uint8_t *Color) // Cloud command parsing fr
if(Accept_Finished_Flag == 1) // LoRa receive finished or not if(Accept_Finished_Flag == 1) // LoRa receive finished or not
{ {
Accept_Finished_Flag = 0; Accept_Finished_Flag = 0;
if(strncmp((char*)USART1_RX_Buffer,buffer,strlen(buffer)) == 0) if(strncmp((char*)USART1_RX_Buffer,buffer,strlen(buffer)) == 0)
{ {
//Usart_SendArray(USART2,USART1_RX_Buffer,strlen((char *)USART1_RX_Buffer)); //Usart_SendArray(USART2,USART1_RX_Buffer,strlen((char *)USART1_RX_Buffer));
@ -272,6 +278,7 @@ void Online_Data_Analysis(volatile uint8_t *Color) // Cloud command parsing fr
case 4: data_len = (USART1_RX_Buffer[index2+1]-'0')*10+USART1_RX_Buffer[index2+2]-'0';break; case 4: data_len = (USART1_RX_Buffer[index2+1]-'0')*10+USART1_RX_Buffer[index2+2]-'0';break;
} }
strncpy(hex_str,(char *)&USART1_RX_Buffer[index1+1],data_len*2); strncpy(hex_str,(char *)&USART1_RX_Buffer[index1+1],data_len*2);
hex2str(hex_str , char_str); hex2str(hex_str , char_str);
@ -289,7 +296,7 @@ void Online_Data_Analysis(volatile uint8_t *Color) // Cloud command parsing fr
Work_Mode = char_str[0] - '0'; // Config work Mode = {0} Network_Mode Work_Mode = char_str[0] - '0'; // Config work Mode = {0} Network_Mode
*Color = char_str[1] - '0'; // Config LED color = {0,1,2,3,4,5,6,8,8} Color code *Color = char_str[1] - '0'; // Config LED color = {0,1,2,3,4,5,6,8,8} Color code
} }
switch (char_str[0]) switch ((char)char_str[0])
{ {
case '0' : { // Network_Mode case '0' : { // Network_Mode
Work_Mode = char_str[0] - '0'; Work_Mode = char_str[0] - '0';
@ -319,11 +326,16 @@ void Online_Data_Analysis(volatile uint8_t *Color) // Cloud command parsing fr
} }
case 'P' : { // Config Radar parameters in following code case 'P' : { // Config Radar parameters in following code
Set_PCR_Parameter(char_str , data_len);
Set_PCR_Parameter((char*)char_str , data_len);
break;
} }
case 'V' : { case 'V' : {
Reply_Version_Info(); Reply_Version_Info();
break;
} }
default:
break;
} }
// if(USART1_RX_Buffer[index1+1] != '5') // if(USART1_RX_Buffer[index1+1] != '5')
// { // {
@ -389,6 +401,7 @@ void Reply_Version_Info()
{ {
Node_Send_Data(userappctrlport, UnConfirmed , 0x56, MajorVer, MinorVer, SubMinorVer); Node_Send_Data(userappctrlport, UnConfirmed , 0x56, MajorVer, MinorVer, SubMinorVer);
/* V 2.1.2 {56 02 01 02} */ /* V 2.1.2 {56 02 01 02} */
} }
@ -396,7 +409,9 @@ void Set_PCR_Parameter(char *str,uint8_t len)
{ {
PCR PCR_parameter; PCR PCR_parameter;
char buffer[128]; char buffer[128];
if(len == 15)
if(len >= 15)
{ {
PCR_parameter.Start = hex2int(str[1])*1000+hex2int(str[2])*100+hex2int(str[3])*10+hex2int(str[4]); PCR_parameter.Start = hex2int(str[1])*1000+hex2int(str[2])*100+hex2int(str[3])*10+hex2int(str[4]);
PCR_parameter.End = hex2int(str[5])*1000+hex2int(str[6])*100+hex2int(str[7])*10+hex2int(str[8]); PCR_parameter.End = hex2int(str[5])*1000+hex2int(str[6])*100+hex2int(str[7])*10+hex2int(str[8]);
@ -433,15 +448,14 @@ void Set_PCR_Parameter(char *str,uint8_t len)
Usart_SendString(USART3 , buffer); Usart_SendString(USART3 , buffer);
LL_mDelay(500); LL_mDelay(500);
// printf("AT+LRSEND=10,0,2,<4F4B\r\n"); "OK" printf("AT+LRSEND=%d,%d,%d,<00\r\n",port,confirm,1); break; } //printf("AT+LRSEND=%d,0,2,<4F4B\r\n", 13);
printf("AT+LRSEND=%d,0,7,<%04x%04x%04x%02x\r\n",cmdreplyport, /* change to port 13= cmdreplyport to align with other config£¬ 2022-09-21 sundp */
PCR_parameter.Start,PCR_parameter.End,PCR_parameter.Threshold,PCR_parameter.Gain); Node_Send_Data(13,UnConfirmed, 0x4F, 0x4B, 0x4F, 0x4B);
//printf("AT+LRSEND=%d,0,7,<%04x%04x%04x%02x\r\n",cmdreplyport, /* change to port 13= cmdreplyport to align with other config£¬ 2022-09-21 sundp */
//PCR_parameter.Start,PCR_parameter.End,PCR_parameter.Threshold,PCR_parameter.Gain);
//change to port 13= cmdreplyport to align with other config /* 2022-09-21 sundp */ //change to port 13= cmdreplyport to align with other config /* 2022-09-21 sundp */
PCR PCR_parameter;
printf("Set Start=%dmm\r\n",PCR_parameter.Start);
printf("Set end=%dmm\r\n",PCR_parameter.End);
printf("Set Threshold=%d\r\n",PCR_parameter.Threshold);
printf("Set Gain=%d%%\r\n",PCR_parameter.Gain);
} }
} }
@ -577,17 +591,27 @@ void M100C_Send_HeartBeat(uint8_t color,uint8_t Mode)
void Node_Send_Data(uint8_t dataport, uint8_t confirm, uint8_t color, uint8_t workmode,uint8_t doorstatus, uint8_t presence_sensor_status) void Node_Send_Data(uint8_t dataport, uint8_t confirm, uint8_t color, uint8_t workmode,uint8_t doorstatus, uint8_t presence_sensor_status)
{ {
// printf("AT+LRSEND=%d,%d,%d,<%02x%02x%02x\r\n",dataport,confirm,3,(uint8_t) color, (uint8_t) workmode, (uint8_t)(doorstatus + presence_sensor_status));
uint8_t i=0;
printf("AT+LRSEND=%d,%d,%d,<%02x%02x%02x%02x\r\n", uint8_t length = 0;
dataport,confirm,4, memset(sendBuffer, 0, sizeof(sendBuffer));
(uint8_t) color, length = snprintf(sendBuffer, sizeof(sendBuffer), "AT+LRSEND=%d,0,4,<%02x%02x%02x%02x\r\n",
(uint8_t) workmode, senddataport, color, workmode, doorstatus,presence_sensor_status);
(uint8_t) !doorstatus, while(length--)
(uint8_t) presence_sensor_status); {
LL_USART_TransmitData8(USART1,(sendBuffer[i++]));
while(LL_USART_IsActiveFlag_TXE(USART1) == RESET){}
}
memset(sendBuffer, 0, sizeof(sendBuffer));
} }
void Node_Config_LoRa_ADR(uint8_t adr_en)
{
if (adr_en==1)
printf("AT+ADREN=1\r\n");
else printf("AT+ADREN=0\r\n");
}
void DMA_USART1_RX_Config(void) void DMA_USART1_RX_Config(void)
@ -648,6 +672,52 @@ int fputc(int ch, FILE *f)
} }
// *************************************************** 2023-06-02 Update
void UsartxSendDataByte(USART_TypeDef* USARTx,uint8_t Data)
{
LL_USART_TransmitData8(USARTx,Data);
while(LL_USART_IsActiveFlag_TXE(USARTx) == RESET){}
}
void UsartxSendDataStr(USART_TypeDef* USARTx,uint8_t *Data,uint32_t len)
{
while(len--)
{
LL_USART_TransmitData8(USARTx,*(Data++));
while(LL_USART_IsActiveFlag_TXE(USARTx) == RESET){}
}
}
uint8_t SendData(uint8_t *sensorData)
{
if( Joined_Mode == 1)
{
uint8_t length = 0;
memset(sendBuffer, 0, sizeof(sendBuffer));
length = snprintf(sendBuffer, sizeof(sendBuffer), "AT+LRSEND=%d,0,5,<%02x%02x%02x%02x%02x\r\n",
senddataport, sensorData[0],sensorData[1],sensorData[2],sensorData[3],sensorData[4]);
UsartxSendDataStr(USART2,(uint8_t *)sendBuffer,length);
return 1;
}
return 0;
}
void SendHeartBeatData(uint8_t sensorData)
{
if( Joined_Mode == 1)
{
uint8_t length = 0;
memset(sendBuffer, 0, sizeof(sendBuffer));
length = snprintf(sendBuffer, sizeof(sendBuffer), "AT+LRSEND=%d,0,1,<%02x\r\n",sendhtbtport, sensorData);
UsartxSendDataStr(USART2,(uint8_t *)sendBuffer,length);
}
}
// *************************************************** 2023-06-02 Update
/***************** ·¢ËÍÒ»¸ö×Ö½Ú **********************/ /***************** ·¢ËÍÒ»¸ö×Ö½Ú **********************/
void Usart_SendByte( USART_TypeDef * pUSARTx, uint8_t ch) void Usart_SendByte( USART_TypeDef * pUSARTx, uint8_t ch)
{ {