Merge branch 'R4' into R1D
This commit is contained in:
commit
c841aa4ba8
|
@ -101,13 +101,18 @@ void Error_Handler(void);
|
|||
#define LED1_OFF HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_RESET)
|
||||
#define LED1_STATE HAL_GPIO_ReadPin(LED1_GPIO_Port, LED1_Pin)
|
||||
#define LED1_TOGGLE HAL_GPIO_TogglePin(LED1_GPIO_Port, LED1_Pin)
|
||||
|
||||
#ifndef L8
|
||||
#define MEMS_POWER_Pin GPIO_PIN_4 // PMU_ENABLE
|
||||
#define MEMS_POWER_GPIO_Port GPIOB // PMU_ENABLE
|
||||
|
||||
#define MEMS_RESET_Pin GPIO_PIN_4
|
||||
#define MEMS_RESET_GPIO_Port GPIOB
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define PME_ON HAL_GPIO_WritePin(MEMS_POWER_GPIO_Port, MEMS_POWER_Pin, GPIO_PIN_SET )
|
||||
#define PME_OFF HAL_GPIO_WritePin(MEMS_POWER_GPIO_Port, MEMS_POWER_Pin, GPIO_PIN_RESET )
|
||||
#define PME_TOGGLE HAL_GPIO_TogglePin(MEMS_POWER_GPIO_Port, MEMS_POWER_Pin)
|
||||
|
@ -225,25 +230,30 @@ void Error_Handler(void);
|
|||
#define I2C2_STANDARD_100K 0x00000E14
|
||||
#define I2C2_FAST_400K 0x00000004
|
||||
#define I2C2_FAST_PLUS_1M 0x00000000
|
||||
#endif
|
||||
|
||||
#else
|
||||
/*
|
||||
* FOR STM32WLE5CCU6 UFQFPN48 PA12 PA11
|
||||
*
|
||||
*/
|
||||
#define I2C2_STANDARD_100K 0x00000E14
|
||||
#define I2C2_FAST_400K 0x00000004
|
||||
#define I2C2_FAST_PLUS_1M 0x00000000
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* FOR STM32WL55JCIX UFBGA73 PA12 PA11
|
||||
*/
|
||||
|
||||
#ifdef STM32WL55xx
|
||||
|
||||
#define I2C2_STANDARD_100K 0x10805D88
|
||||
#define I2C2_FAST_400K 0x0090194B
|
||||
#define I2C2_FAST_PLUS_1M 0x00700814
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if defined(STS_R4)
|
||||
/* IF_SOAP_IN, MEMS_IF_3, PA10 */
|
||||
#define SOAP_STATUS_Pin GPIO_PIN_10
|
||||
|
|
|
@ -59,6 +59,11 @@ void MX_DMA_Init(void)
|
|||
#endif
|
||||
#endif
|
||||
|
||||
/* DMA1_Channel5_IRQn interrupt configuration */
|
||||
|
||||
// HAL_NVIC_SetPriority(DMA1_Channel5_IRQn, 2, 0);
|
||||
// HAL_NVIC_EnableIRQ(DMA1_Channel5_IRQn);
|
||||
|
||||
// I2C2
|
||||
/* DMA1_Channel4_IRQn interrupt configuration */
|
||||
HAL_NVIC_SetPriority(DMA1_Channel4_IRQn, 0, 0);
|
||||
|
@ -72,13 +77,13 @@ void MX_DMA_Init(void)
|
|||
HAL_NVIC_SetPriority(DMA1_Channel6_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(DMA1_Channel6_IRQn);
|
||||
/* DMA1_Channel7_IRQn interrupt configuration */
|
||||
HAL_NVIC_SetPriority(DMA1_Channel7_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(DMA1_Channel7_IRQn);
|
||||
#if 0
|
||||
/* DMA1_Channel5_IRQn interrupt configuration */
|
||||
//HAL_NVIC_SetPriority(DMA1_Channel7_IRQn, 0, 0);
|
||||
//HAL_NVIC_EnableIRQ(DMA1_Channel7_IRQn);
|
||||
|
||||
HAL_NVIC_SetPriority(DMA1_Channel5_IRQn, 2, 0);
|
||||
HAL_NVIC_EnableIRQ(DMA1_Channel5_IRQn);
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
|
|
@ -81,7 +81,8 @@ void MX_GPIO_Init(void)
|
|||
GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
HAL_GPIO_Init(BUT3_GPIO_Port, &GPIO_InitStruct);
|
||||
#if 1
|
||||
|
||||
#ifndef L8
|
||||
/* STS-PME PB-4 */
|
||||
/*Configure GPIO pins : PBPin PBPin PBPin */
|
||||
GPIO_InitStruct.Pin = MEMS_POWER_Pin;
|
||||
|
|
|
@ -43,7 +43,11 @@ void MX_I2C2_Init(void)
|
|||
|
||||
/* USER CODE END I2C2_Init 1 */
|
||||
hi2c2.Instance = I2C2;
|
||||
#ifdef L8
|
||||
hi2c2.Init.Timing = I2C2_FAST_PLUS_1M;
|
||||
#else
|
||||
hi2c2.Init.Timing = I2C2_STANDARD_100K;
|
||||
#endif
|
||||
hi2c2.Init.OwnAddress1 = 0;
|
||||
hi2c2.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
|
||||
hi2c2.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
|
||||
|
|
|
@ -101,6 +101,7 @@ int main(void)
|
|||
|
||||
/* Initialize all configured peripherals */
|
||||
MX_GPIO_Init();
|
||||
|
||||
#if 0
|
||||
if(__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET)
|
||||
{
|
||||
|
@ -112,8 +113,6 @@ int main(void)
|
|||
MX_I2C2_Init();
|
||||
MX_DMA_Init();
|
||||
MX_LoRaWAN_Init();
|
||||
//MX_USART2_UART_Init();
|
||||
printf("Normal bootup\n");
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
|
|
@ -58,6 +58,7 @@
|
|||
extern RTC_HandleTypeDef hrtc;
|
||||
extern SUBGHZ_HandleTypeDef hsubghz;
|
||||
extern DMA_HandleTypeDef hdma_usart2_tx;
|
||||
extern DMA_HandleTypeDef hdma_usart2_rx;
|
||||
extern UART_HandleTypeDef huart2;
|
||||
/* USER CODE BEGIN EV */
|
||||
extern DMA_HandleTypeDef hdma_i2c2_rx;
|
||||
|
@ -259,6 +260,7 @@ void EXTI3_IRQHandler(void)
|
|||
/* USER CODE END EXTI3_IRQn 1 */
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief This function handles EXTI Line 1 Interrupt.
|
||||
*/
|
||||
|
@ -272,6 +274,36 @@ void EXTI4_IRQHandler(void)
|
|||
|
||||
/* USER CODE END EXTI1_IRQn 1 */
|
||||
}
|
||||
|
||||
/* SPI1 */
|
||||
/**
|
||||
* @brief This function handles DMA1 Channel 2 Interrupt.
|
||||
*/
|
||||
void DMA1_Channel2_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN DMA1_Channel2_IRQn 0 */
|
||||
|
||||
/* USER CODE END DMA1_Channel2_IRQn 0 */
|
||||
//HAL_DMA_IRQHandler(&hdma_spi1_rx);
|
||||
/* USER CODE BEGIN DMA1_Channel2_IRQn 1 */
|
||||
|
||||
/* USER CODE END DMA1_Channel2_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles DMA1 Channel 3 Interrupt.
|
||||
*/
|
||||
void DMA1_Channel3_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN DMA1_Channel3_IRQn 0 */
|
||||
|
||||
/* USER CODE END DMA1_Channel3_IRQn 0 */
|
||||
//HAL_DMA_IRQHandler(&hdma_spi1_tx);
|
||||
/* USER CODE BEGIN DMA1_Channel3_IRQn 1 */
|
||||
|
||||
/* USER CODE END DMA1_Channel3_IRQn 1 */
|
||||
}
|
||||
|
||||
/* I2C2 */
|
||||
|
||||
/**
|
||||
|
@ -296,12 +328,15 @@ void DMA1_Channel5_IRQHandler(void)
|
|||
/* USER CODE BEGIN DMA1_Channel5_IRQn 0 */
|
||||
|
||||
/* USER CODE END DMA1_Channel5_IRQn 0 */
|
||||
HAL_DMA_IRQHandler(&hdma_i2c2_tx);
|
||||
|
||||
HAL_DMA_IRQHandler(&hdma_i2c2_tx);
|
||||
|
||||
/* USER CODE BEGIN DMA1_Channel5_IRQn 1 */
|
||||
|
||||
/* USER CODE END DMA1_Channel5_IRQn 1 */
|
||||
}
|
||||
|
||||
// USART2
|
||||
/**
|
||||
* @brief This function handles DMA1 Channel 6 Interrupt.
|
||||
*/
|
||||
|
@ -324,7 +359,7 @@ void DMA1_Channel7_IRQHandler(void)
|
|||
/* USER CODE BEGIN DMA1_Channel7_IRQn 0 */
|
||||
|
||||
/* USER CODE END DMA1_Channel7_IRQn 0 */
|
||||
HAL_DMA_IRQHandler(&hdma_usart2_rx);
|
||||
//HAL_DMA_IRQHandler(&hdma_usart2_rx);
|
||||
/* USER CODE BEGIN DMA1_Channel7_IRQn 1 */
|
||||
|
||||
/* USER CODE END DMA1_Channel7_IRQn 1 */
|
||||
|
@ -357,13 +392,16 @@ void EXTI15_10_IRQHandler(void)
|
|||
/* USER CODE BEGIN EXTI15_10_IRQn 0 */
|
||||
|
||||
/* USER CODE END EXTI15_10_IRQn 0 */
|
||||
|
||||
#if defined(L8)||defined(STS_P2)||defined(STS_R1D)||defined(STS_R5)
|
||||
HAL_GPIO_EXTI_IRQHandler(TOF_INT_EXTI_PIN);
|
||||
#endif
|
||||
|
||||
/* USER CODE BEGIN EXTI15_10_IRQn 1 */
|
||||
|
||||
/* USER CODE END EXTI15_10_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles USART2 Interrupt.
|
||||
*/
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
UART_HandleTypeDef huart2;
|
||||
DMA_HandleTypeDef hdma_usart2_tx;
|
||||
DMA_HandleTypeDef hdma_usart2_rx;
|
||||
|
||||
/* USART2 init function */
|
||||
|
||||
void MX_USART2_UART_Init(void)
|
||||
|
@ -133,7 +134,7 @@ void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle)
|
|||
}
|
||||
#endif
|
||||
__HAL_LINKDMA(uartHandle,hdmatx,hdma_usart2_tx);
|
||||
|
||||
#if 0
|
||||
/* USART2_RX Init */
|
||||
hdma_usart2_rx.Instance = DMA1_Channel7;
|
||||
hdma_usart2_rx.Init.Request = DMA_REQUEST_USART2_RX;
|
||||
|
@ -154,7 +155,9 @@ void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle)
|
|||
Error_Handler();
|
||||
}
|
||||
#endif
|
||||
__HAL_LINKDMA(uartHandle,hdmatx,hdma_usart2_tx);
|
||||
__HAL_LINKDMA(uartHandle,hdmarx,hdma_usart2_rx);
|
||||
#endif
|
||||
|
||||
|
||||
/* USART2 interrupt Init */
|
||||
HAL_NVIC_SetPriority(USART2_IRQn, 2, 0);
|
||||
|
@ -184,7 +187,8 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle)
|
|||
|
||||
/* USART2 DMA DeInit */
|
||||
HAL_DMA_DeInit(uartHandle->hdmatx);
|
||||
HAL_DMA_DeInit(uartHandle->hdmarx);
|
||||
|
||||
//HAL_DMA_DeInit(uartHandle->hdmarx);
|
||||
|
||||
/* USART2 interrupt Deinit */
|
||||
HAL_NVIC_DisableIRQ(USART2_IRQn);
|
||||
|
|
|
@ -127,7 +127,7 @@ UTIL_ADV_TRACE_Status_t vcom_DeInit(void)
|
|||
|
||||
/* ##-3- Disable the NVIC for DMA ########################################### */
|
||||
/* USER CODE BEGIN 1 */
|
||||
HAL_NVIC_DisableIRQ(DMA1_Channel5_IRQn);
|
||||
HAL_NVIC_DisableIRQ(DMA1_Channel6_IRQn);
|
||||
|
||||
return UTIL_ADV_TRACE_OK;
|
||||
/* USER CODE END 1 */
|
||||
|
|
|
@ -491,6 +491,9 @@ void LoRaWAN_Init(void)
|
|||
|
||||
LmHandlerJoin(ActivationType, ForceRejoin);
|
||||
|
||||
UTIL_TIMER_Create(&YunhornSTSHeartBeatTimer, 1000*STS_HeartBeatTimerPeriod_sec, UTIL_TIMER_ONESHOT, OnYunhornSTSHeartBeatTimerEvent, NULL);
|
||||
UTIL_TIMER_Start(&YunhornSTSHeartBeatTimer);
|
||||
|
||||
if (EventType == TX_ON_TIMER)
|
||||
{
|
||||
|
||||
|
@ -538,8 +541,8 @@ void LoRaWAN_Init(void)
|
|||
#endif
|
||||
|
||||
//UTIL_TIMER_Create(&YunhornSTSHeartBeatTimer, 1000*STS_HeartBeatTimerPeriod_sec, UTIL_TIMER_PERIODIC, OnYunhornSTSHeartBeatTimerEvent, NULL);
|
||||
UTIL_TIMER_Create(&YunhornSTSHeartBeatTimer, 1000*STS_HeartBeatTimerPeriod_sec, UTIL_TIMER_ONESHOT, OnYunhornSTSHeartBeatTimerEvent, NULL);
|
||||
UTIL_TIMER_Start(&YunhornSTSHeartBeatTimer);
|
||||
// UTIL_TIMER_Create(&YunhornSTSHeartBeatTimer, 1000*STS_HeartBeatTimerPeriod_sec, UTIL_TIMER_ONESHOT, OnYunhornSTSHeartBeatTimerEvent, NULL);
|
||||
// UTIL_TIMER_Start(&YunhornSTSHeartBeatTimer);
|
||||
|
||||
/* USER CODE END LoRaWAN_Init_Last */
|
||||
}
|
||||
|
@ -1112,7 +1115,6 @@ static void OnJoinRequest(LmHandlerJoinParams_t *joinParams)
|
|||
LmHandlerParams.IsTxConfirmed = true;
|
||||
LmHandlerErrorStatus_t status = LmHandlerSend(&AppData, LmHandlerParams.IsTxConfirmed, false);
|
||||
if (status ==LORAMAC_HANDLER_SUCCESS ) LmHandlerParams.IsTxConfirmed = false;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1462,26 +1464,27 @@ static void OnYunhornSTSHeartBeatTimerEvent(void *context)
|
|||
* @brief Yunhorn STS Heart Beat Periodicity Chagne function
|
||||
* @param duration of periodicty in ms (1/1000 sec)
|
||||
*/
|
||||
void OnYunhornSTSHeartBeatPeriodicityChanged(uint32_t newperiodicity)
|
||||
void OnYunhornSTSHeartBeatPeriodicityChanged(uint32_t periodicity)
|
||||
{
|
||||
/* USER CODE BEGIN OnYunhornSTSHeartBeatPeriodicityChanged_1 */
|
||||
|
||||
/* USER CODE END OnYunhornSTSHeartBeatPeriodicityChanged_1 */
|
||||
|
||||
if (newperiodicity == 0)
|
||||
if (periodicity == 0)
|
||||
{
|
||||
/* Revert to application default Heat-beat periodicity */
|
||||
newperiodicity = 10*APP_TX_DUTYCYCLE; //10*10 000 ms
|
||||
periodicity = 10*APP_TX_DUTYCYCLE; //10*10 000 ms
|
||||
}
|
||||
|
||||
/* Update timer YunhornSTSHeartBeatTimer */
|
||||
|
||||
UTIL_TIMER_Stop(&YunhornSTSHeartBeatTimer);
|
||||
UTIL_TIMER_SetPeriod(&YunhornSTSHeartBeatTimer, newperiodicity);
|
||||
UTIL_TIMER_SetPeriod(&YunhornSTSHeartBeatTimer, periodicity);
|
||||
UTIL_TIMER_Start(&YunhornSTSHeartBeatTimer);
|
||||
|
||||
/* USER CODE BEGIN OnYunhornSTSHeartBeatPeriodicityChanged_2 */
|
||||
APP_LOG(TS_OFF, VLEVEL_M,"* STS HeartBeatPeriodicity = %u (sec)\r\n", newperiodicity/1000 );
|
||||
APP_LOG(TS_OFF, VLEVEL_M,"* STS HeartBeatPeriodicity = %u (sec)\r\n", periodicity/1000 );
|
||||
|
||||
/* USER CODE END OnYunhornSTSHeartBeatPeriodicityChanged_2 */
|
||||
}
|
||||
|
||||
|
@ -1507,13 +1510,17 @@ void OnYunhornSTSTxPeriodicityChanged(uint32_t periodicity)
|
|||
/* USER CODE END OnYunhornSTSTxPeriodicityChanged */
|
||||
|
||||
/* Update timer OnYunhornSTSTxPeriodicityChanged */
|
||||
|
||||
OnTxPeriodicityChanged(periodicity);
|
||||
/*
|
||||
UTIL_TIMER_Stop(&TxTimer);
|
||||
TxPeriodicity = periodicity;
|
||||
UTIL_TIMER_SetPeriod(&TxTimer, TxPeriodicity);
|
||||
UTIL_TIMER_Start(&TxTimer);
|
||||
*/
|
||||
|
||||
/* USER CODE BEGIN OnYunhornSTSTxPeriodicityChanged */
|
||||
APP_LOG(TS_OFF, VLEVEL_M,"* STS TxPeriodicity = %u (sec)\r\n", TxPeriodicity/1000 );
|
||||
|
||||
APP_LOG(TS_OFF, VLEVEL_H,"\n* STS TxPeriodicity = %u (sec)\r\n", TxPeriodicity/1000 );
|
||||
|
||||
/* USER CODE END OnYunhornSTSTxPeriodicityChanged */
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ extern "C" {
|
|||
/*!
|
||||
* LoRaWAN default class
|
||||
*/
|
||||
#define LORAWAN_DEFAULT_CLASS CLASS_A
|
||||
#define LORAWAN_DEFAULT_CLASS CLASS_C
|
||||
|
||||
/*!
|
||||
* LoRaWAN default confirm state
|
||||
|
|
|
@ -109,7 +109,7 @@ extern "C" {
|
|||
* - CHANNEL_PLAN_GROUP_AS923_4 (Freq offset = -5.90 MHz / Freq range = 917-920MHz)
|
||||
* - CHANNEL_PLAN_GROUP_AS923_1_JP (Freq offset = 0.0 MHz / Freq range = 920.6-923.4MHz)
|
||||
*/
|
||||
#define REGION_AS923_DEFAULT_CHANNEL_PLAN CHANNEL_PLAN_GROUP_AS923_1_JP
|
||||
#define REGION_AS923_DEFAULT_CHANNEL_PLAN CHANNEL_PLAN_GROUP_AS923_1
|
||||
|
||||
/*!
|
||||
* @brief Limits the number usable channels by default for AU915, CN470 and US915 regions
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
################################################################################
|
||||
# Automatically-generated file. Do not edit!
|
||||
# Toolchain: GNU Tools for STM32 (12.3.rel1)
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
################################################################################
|
||||
# Automatically-generated file. Do not edit!
|
||||
# Toolchain: GNU Tools for STM32 (12.3.rel1)
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
################################################################################
|
||||
# Automatically-generated file. Do not edit!
|
||||
# Toolchain: GNU Tools for STM32 (12.3.rel1)
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
################################################################################
|
||||
# Automatically-generated file. Do not edit!
|
||||
# Toolchain: GNU Tools for STM32 (12.3.rel1)
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
################################################################################
|
||||
# Automatically-generated file. Do not edit!
|
||||
# Toolchain: GNU Tools for STM32 (12.3.rel1)
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
C_SRCS += \
|
||||
/53l8a1_ranging_sensor.c
|
||||
|
||||
OBJS += \
|
||||
./Drivers/BSP/53L8A1/53l8a1_ranging_sensor.o
|
||||
|
||||
C_DEPS += \
|
||||
./Drivers/BSP/53L8A1/53l8a1_ranging_sensor.d
|
||||
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
Drivers/BSP/53L8A1/53l8a1_ranging_sensor.o: /53l8a1_ranging_sensor.c Drivers/BSP/53L8A1/subdir.mk
|
||||
arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_R4 -DCORE_CM4 -DUSE_HAL_DRIVER -DSTM32WLE5xx -c -I../../Core/Inc -I../../STS/Core/Inc -I../../STS/TOF/App -I../../STS/TOF/Target -I../../STS/TOF/vl53l1x_uld -I../../STS/TOF/vl53l0x -I../../LoRaWAN/App -I../../LoRaWAN/Target -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc/Legacy -I../../../../../../../Utilities/trace/adv_trace -I../../../../../../../Utilities/misc -I../../../../../../../Utilities/sequencer -I../../../../../../../Utilities/timer -I../../../../../../../Utilities/lpm/tiny_lpm -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler/Packages -I../../../../../../../Drivers/CMSIS/Device/ST/STM32WLxx/Include -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Crypto -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac/Region -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Utilities -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver -I../../../../../../../Middlewares/ST/STM32_Cryptographic/include -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/BSP/STM32WLxx_Nucleo -I../../../../../../../Drivers/BSP/Components/vl53l8cx/porting -I../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../Drivers/BSP/53L8A1 -I../../../../../../../Drivers/BSP/Components/vl53l8cx/modules -I../../../../../../../Drivers/BSP/Components/vl53l8cx -Os -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
|
||||
|
||||
clean: clean-Drivers-2f-BSP-2f-53L8A1
|
||||
|
||||
clean-Drivers-2f-BSP-2f-53L8A1:
|
||||
-$(RM) ./Drivers/BSP/53L8A1/53l8a1_ranging_sensor.cyclo ./Drivers/BSP/53L8A1/53l8a1_ranging_sensor.d ./Drivers/BSP/53L8A1/53l8a1_ranging_sensor.o ./Drivers/BSP/53L8A1/53l8a1_ranging_sensor.su
|
||||
|
||||
.PHONY: clean-Drivers-2f-BSP-2f-53L8A1
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
################################################################################
|
||||
# Automatically-generated file. Do not edit!
|
||||
# Toolchain: GNU Tools for STM32 (12.3.rel1)
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
C_SRCS += \
|
||||
D:/ONEDRIVE/STM32WLV13/Drivers/BSP/Components/vl53l8cx/vl53l8cx.c \
|
||||
D:/ONEDRIVE/STM32WLV13/Drivers/BSP/Components/vl53l8cx/modules/vl53l8cx_api.c \
|
||||
D:/ONEDRIVE/STM32WLV13/Drivers/BSP/Components/vl53l8cx/modules/vl53l8cx_plugin_detection_thresholds.c \
|
||||
D:/ONEDRIVE/STM32WLV13/Drivers/BSP/Components/vl53l8cx/modules/vl53l8cx_plugin_motion_indicator.c \
|
||||
D:/ONEDRIVE/STM32WLV13/Drivers/BSP/Components/vl53l8cx/modules/vl53l8cx_plugin_xtalk.c \
|
||||
D:/ONEDRIVE/STM32WLV13/Drivers/BSP/Components/vl53l8cx/porting/wle5cc_platform.c
|
||||
|
||||
OBJS += \
|
||||
./Drivers/BSP/Components/vl53l8cx.o \
|
||||
./Drivers/BSP/Components/vl53l8cx_api.o \
|
||||
./Drivers/BSP/Components/vl53l8cx_plugin_detection_thresholds.o \
|
||||
./Drivers/BSP/Components/vl53l8cx_plugin_motion_indicator.o \
|
||||
./Drivers/BSP/Components/vl53l8cx_plugin_xtalk.o \
|
||||
./Drivers/BSP/Components/wle5cc_platform.o
|
||||
|
||||
C_DEPS += \
|
||||
./Drivers/BSP/Components/vl53l8cx.d \
|
||||
./Drivers/BSP/Components/vl53l8cx_api.d \
|
||||
./Drivers/BSP/Components/vl53l8cx_plugin_detection_thresholds.d \
|
||||
./Drivers/BSP/Components/vl53l8cx_plugin_motion_indicator.d \
|
||||
./Drivers/BSP/Components/vl53l8cx_plugin_xtalk.d \
|
||||
./Drivers/BSP/Components/wle5cc_platform.d
|
||||
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
Drivers/BSP/Components/vl53l8cx.o: D:/ONEDRIVE/STM32WLV13/Drivers/BSP/Components/vl53l8cx/vl53l8cx.c Drivers/BSP/Components/subdir.mk
|
||||
arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_R4 -DCORE_CM4 -DUSE_HAL_DRIVER -DSTM32WLE5xx -c -I../../Core/Inc -I../../STS/Core/Inc -I../../STS/TOF/App -I../../STS/TOF/Target -I../../STS/TOF/vl53l1x_uld -I../../STS/TOF/vl53l0x -I../../LoRaWAN/App -I../../LoRaWAN/Target -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc/Legacy -I../../../../../../../Utilities/trace/adv_trace -I../../../../../../../Utilities/misc -I../../../../../../../Utilities/sequencer -I../../../../../../../Utilities/timer -I../../../../../../../Utilities/lpm/tiny_lpm -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler/Packages -I../../../../../../../Drivers/CMSIS/Device/ST/STM32WLxx/Include -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Crypto -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac/Region -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Utilities -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver -I../../../../../../../Middlewares/ST/STM32_Cryptographic/include -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/BSP/STM32WLxx_Nucleo -I../../../../../../../Drivers/BSP/Components/vl53l8cx/porting -I../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../Drivers/BSP/53L8A1 -I../../../../../../../Drivers/BSP/Components/vl53l8cx/modules -I../../../../../../../Drivers/BSP/Components/vl53l8cx -Os -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
|
||||
Drivers/BSP/Components/vl53l8cx_api.o: D:/ONEDRIVE/STM32WLV13/Drivers/BSP/Components/vl53l8cx/modules/vl53l8cx_api.c Drivers/BSP/Components/subdir.mk
|
||||
arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_R4 -DCORE_CM4 -DUSE_HAL_DRIVER -DSTM32WLE5xx -c -I../../Core/Inc -I../../STS/Core/Inc -I../../STS/TOF/App -I../../STS/TOF/Target -I../../STS/TOF/vl53l1x_uld -I../../STS/TOF/vl53l0x -I../../LoRaWAN/App -I../../LoRaWAN/Target -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc/Legacy -I../../../../../../../Utilities/trace/adv_trace -I../../../../../../../Utilities/misc -I../../../../../../../Utilities/sequencer -I../../../../../../../Utilities/timer -I../../../../../../../Utilities/lpm/tiny_lpm -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler/Packages -I../../../../../../../Drivers/CMSIS/Device/ST/STM32WLxx/Include -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Crypto -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac/Region -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Utilities -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver -I../../../../../../../Middlewares/ST/STM32_Cryptographic/include -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/BSP/STM32WLxx_Nucleo -I../../../../../../../Drivers/BSP/Components/vl53l8cx/porting -I../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../Drivers/BSP/53L8A1 -I../../../../../../../Drivers/BSP/Components/vl53l8cx/modules -I../../../../../../../Drivers/BSP/Components/vl53l8cx -Os -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
|
||||
Drivers/BSP/Components/vl53l8cx_plugin_detection_thresholds.o: D:/ONEDRIVE/STM32WLV13/Drivers/BSP/Components/vl53l8cx/modules/vl53l8cx_plugin_detection_thresholds.c Drivers/BSP/Components/subdir.mk
|
||||
arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_R4 -DCORE_CM4 -DUSE_HAL_DRIVER -DSTM32WLE5xx -c -I../../Core/Inc -I../../STS/Core/Inc -I../../STS/TOF/App -I../../STS/TOF/Target -I../../STS/TOF/vl53l1x_uld -I../../STS/TOF/vl53l0x -I../../LoRaWAN/App -I../../LoRaWAN/Target -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc/Legacy -I../../../../../../../Utilities/trace/adv_trace -I../../../../../../../Utilities/misc -I../../../../../../../Utilities/sequencer -I../../../../../../../Utilities/timer -I../../../../../../../Utilities/lpm/tiny_lpm -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler/Packages -I../../../../../../../Drivers/CMSIS/Device/ST/STM32WLxx/Include -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Crypto -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac/Region -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Utilities -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver -I../../../../../../../Middlewares/ST/STM32_Cryptographic/include -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/BSP/STM32WLxx_Nucleo -I../../../../../../../Drivers/BSP/Components/vl53l8cx/porting -I../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../Drivers/BSP/53L8A1 -I../../../../../../../Drivers/BSP/Components/vl53l8cx/modules -I../../../../../../../Drivers/BSP/Components/vl53l8cx -Os -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
|
||||
Drivers/BSP/Components/vl53l8cx_plugin_motion_indicator.o: D:/ONEDRIVE/STM32WLV13/Drivers/BSP/Components/vl53l8cx/modules/vl53l8cx_plugin_motion_indicator.c Drivers/BSP/Components/subdir.mk
|
||||
arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_R4 -DCORE_CM4 -DUSE_HAL_DRIVER -DSTM32WLE5xx -c -I../../Core/Inc -I../../STS/Core/Inc -I../../STS/TOF/App -I../../STS/TOF/Target -I../../STS/TOF/vl53l1x_uld -I../../STS/TOF/vl53l0x -I../../LoRaWAN/App -I../../LoRaWAN/Target -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc/Legacy -I../../../../../../../Utilities/trace/adv_trace -I../../../../../../../Utilities/misc -I../../../../../../../Utilities/sequencer -I../../../../../../../Utilities/timer -I../../../../../../../Utilities/lpm/tiny_lpm -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler/Packages -I../../../../../../../Drivers/CMSIS/Device/ST/STM32WLxx/Include -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Crypto -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac/Region -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Utilities -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver -I../../../../../../../Middlewares/ST/STM32_Cryptographic/include -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/BSP/STM32WLxx_Nucleo -I../../../../../../../Drivers/BSP/Components/vl53l8cx/porting -I../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../Drivers/BSP/53L8A1 -I../../../../../../../Drivers/BSP/Components/vl53l8cx/modules -I../../../../../../../Drivers/BSP/Components/vl53l8cx -Os -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
|
||||
Drivers/BSP/Components/vl53l8cx_plugin_xtalk.o: D:/ONEDRIVE/STM32WLV13/Drivers/BSP/Components/vl53l8cx/modules/vl53l8cx_plugin_xtalk.c Drivers/BSP/Components/subdir.mk
|
||||
arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_R4 -DCORE_CM4 -DUSE_HAL_DRIVER -DSTM32WLE5xx -c -I../../Core/Inc -I../../STS/Core/Inc -I../../STS/TOF/App -I../../STS/TOF/Target -I../../STS/TOF/vl53l1x_uld -I../../STS/TOF/vl53l0x -I../../LoRaWAN/App -I../../LoRaWAN/Target -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc/Legacy -I../../../../../../../Utilities/trace/adv_trace -I../../../../../../../Utilities/misc -I../../../../../../../Utilities/sequencer -I../../../../../../../Utilities/timer -I../../../../../../../Utilities/lpm/tiny_lpm -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler/Packages -I../../../../../../../Drivers/CMSIS/Device/ST/STM32WLxx/Include -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Crypto -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac/Region -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Utilities -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver -I../../../../../../../Middlewares/ST/STM32_Cryptographic/include -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/BSP/STM32WLxx_Nucleo -I../../../../../../../Drivers/BSP/Components/vl53l8cx/porting -I../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../Drivers/BSP/53L8A1 -I../../../../../../../Drivers/BSP/Components/vl53l8cx/modules -I../../../../../../../Drivers/BSP/Components/vl53l8cx -Os -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
|
||||
Drivers/BSP/Components/wle5cc_platform.o: D:/ONEDRIVE/STM32WLV13/Drivers/BSP/Components/vl53l8cx/porting/wle5cc_platform.c Drivers/BSP/Components/subdir.mk
|
||||
arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_R4 -DCORE_CM4 -DUSE_HAL_DRIVER -DSTM32WLE5xx -c -I../../Core/Inc -I../../STS/Core/Inc -I../../STS/TOF/App -I../../STS/TOF/Target -I../../STS/TOF/vl53l1x_uld -I../../STS/TOF/vl53l0x -I../../LoRaWAN/App -I../../LoRaWAN/Target -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc/Legacy -I../../../../../../../Utilities/trace/adv_trace -I../../../../../../../Utilities/misc -I../../../../../../../Utilities/sequencer -I../../../../../../../Utilities/timer -I../../../../../../../Utilities/lpm/tiny_lpm -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler/Packages -I../../../../../../../Drivers/CMSIS/Device/ST/STM32WLxx/Include -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Crypto -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac/Region -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Utilities -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver -I../../../../../../../Middlewares/ST/STM32_Cryptographic/include -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/BSP/STM32WLxx_Nucleo -I../../../../../../../Drivers/BSP/Components/vl53l8cx/porting -I../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../Drivers/BSP/53L8A1 -I../../../../../../../Drivers/BSP/Components/vl53l8cx/modules -I../../../../../../../Drivers/BSP/Components/vl53l8cx -Os -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
|
||||
|
||||
clean: clean-Drivers-2f-BSP-2f-Components
|
||||
|
||||
clean-Drivers-2f-BSP-2f-Components:
|
||||
-$(RM) ./Drivers/BSP/Components/vl53l8cx.cyclo ./Drivers/BSP/Components/vl53l8cx.d ./Drivers/BSP/Components/vl53l8cx.o ./Drivers/BSP/Components/vl53l8cx.su ./Drivers/BSP/Components/vl53l8cx_api.cyclo ./Drivers/BSP/Components/vl53l8cx_api.d ./Drivers/BSP/Components/vl53l8cx_api.o ./Drivers/BSP/Components/vl53l8cx_api.su ./Drivers/BSP/Components/vl53l8cx_plugin_detection_thresholds.cyclo ./Drivers/BSP/Components/vl53l8cx_plugin_detection_thresholds.d ./Drivers/BSP/Components/vl53l8cx_plugin_detection_thresholds.o ./Drivers/BSP/Components/vl53l8cx_plugin_detection_thresholds.su ./Drivers/BSP/Components/vl53l8cx_plugin_motion_indicator.cyclo ./Drivers/BSP/Components/vl53l8cx_plugin_motion_indicator.d ./Drivers/BSP/Components/vl53l8cx_plugin_motion_indicator.o ./Drivers/BSP/Components/vl53l8cx_plugin_motion_indicator.su ./Drivers/BSP/Components/vl53l8cx_plugin_xtalk.cyclo ./Drivers/BSP/Components/vl53l8cx_plugin_xtalk.d ./Drivers/BSP/Components/vl53l8cx_plugin_xtalk.o ./Drivers/BSP/Components/vl53l8cx_plugin_xtalk.su ./Drivers/BSP/Components/wle5cc_platform.cyclo ./Drivers/BSP/Components/wle5cc_platform.d ./Drivers/BSP/Components/wle5cc_platform.o ./Drivers/BSP/Components/wle5cc_platform.su
|
||||
|
||||
.PHONY: clean-Drivers-2f-BSP-2f-Components
|
||||
|
Binary file not shown.
|
@ -59,12 +59,12 @@ volatile sts_cfg_nvm_t sts_cfg_nvm = {
|
|||
sts_hardware_ver,
|
||||
0x05, //Regular TxPeriodicity interval
|
||||
'M', //Uplink data interval unit, for heart-beat uplink
|
||||
#if defined(STS_P2)||defined(STS_L8)
|
||||
#if defined(STS_P2)||defined(L8)||defined(STS_O6T)||defined(STS_T6)
|
||||
0x01, //Heart-beat interval or Sampling interval
|
||||
'S', //Sampling sensor interval unit, for real-time sensing of MEMS
|
||||
#else
|
||||
0x3C, //Heart-beat interval or Sampling interval
|
||||
'M', //Sampling sensor interval unit, for real-time sensing of MEMS
|
||||
0x3C, //Heart-beat interval , for heart-beat uplink
|
||||
'M', //Heart-beat interval unit
|
||||
#endif
|
||||
0x04, // dual mode=4, uni_mode =5
|
||||
0x00, // sts service mask
|
||||
|
@ -110,7 +110,7 @@ volatile sts_cfg_nvm_t sts_cfg_nvm = {
|
|||
// below 20 bytes for RFAC code
|
||||
{0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,0x0}
|
||||
};
|
||||
//volatile uint8_t nvm_store_value[YUNHORN_STS_MAX_NVM_CFG_SIZE]={0x0};
|
||||
volatile uint8_t nvm_store_value[YUNHORN_STS_MAX_NVM_CFG_SIZE]={0x0};
|
||||
volatile uint8_t sts_ac_code[20]={0x0};
|
||||
volatile uint8_t sts_service_mask=STS_SERVICE_MASK_L0;
|
||||
volatile uint8_t sts_work_mode=4;
|
||||
|
@ -120,10 +120,8 @@ volatile uint8_t sensor_data_ready=0;
|
|||
|
||||
#if defined(STS_R1)||defined(STS_R5)||defined(STS_R4)||defined(STS_R1D)
|
||||
volatile uint32_t STS_TOFScanPeriod_msec=50, STS_TxPeriod_sec=30, STS_HeartBeatTimerPeriod_sec=3600;
|
||||
#endif
|
||||
|
||||
#if defined(STS_L8)||defined(STS_P2)||defined(STS_O6T)||defined(STS_T6)
|
||||
volatile uint32_t STS_TOFScanPeriod_msec=5000, STS_TxPeriod_sec=10, STS_HeartBeatTimerPeriod_sec=60;
|
||||
#elif defined(STS_L8)||defined(STS_P2)||defined(STS_O6T)||defined(STS_T6)
|
||||
volatile uint32_t STS_TOFScanPeriod_msec=5000, STS_TxPeriod_sec=10, STS_HeartBeatTimerPeriod_sec=300;
|
||||
#endif
|
||||
|
||||
static uint8_t outbuf[128]={0x0};
|
||||
|
@ -482,7 +480,7 @@ void STS_YunhornSTSEventP6_Process(void)
|
|||
//sts_soap_level_state = 0;
|
||||
sts_soap_level_state = HAL_GPIO_ReadPin(SOAP_STATUS_GPIO_Port,SOAP_STATUS_Pin);
|
||||
//APP_LOG(TS_OFF, VLEVEL_M, "\r\n Soap State = 0x%02X \r\n", sts_soap_level_state);
|
||||
APP_LOG(TS_OFF, VLEVEL_L, "\r\n Soap State = %s \r\n", (sts_soap_level_state==0x0)?" +++ Liquid Detected":" --- No Liquid");
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n Soap State read=%02x State: %s \r\n", sts_soap_level_state, (sts_soap_level_state==0x0)?" +++ Liquid Detected":" --- No Liquid");
|
||||
|
||||
HAL_GPIO_WritePin(SOAP_SWITCH_GPIO_Port, SOAP_SWITCH_Pin, GPIO_PIN_RESET);
|
||||
|
||||
|
@ -1231,7 +1229,7 @@ void USER_APP_AUTO_RESPONDER_Parse(uint8_t *parse_buffer, uint8_t parse_buffer_s
|
|||
STS_TxPeriod_sec = periodicity_length;
|
||||
|
||||
TxPeriodicity = periodicity_length*1000;
|
||||
APP_LOG(TS_OFF,VLEVEL_M, "\nTx Periodicty changed to %u", TxPeriodicity);
|
||||
APP_LOG(TS_OFF,VLEVEL_M, "\nSTS Tx Periodicty changed to %u sec\n\r", STS_TxPeriod_sec);
|
||||
#ifdef STS_R4
|
||||
OnYunhornSTSTxPeriodicityChanged(STS_TxPeriod_sec*1000);
|
||||
#endif
|
||||
|
@ -1363,11 +1361,7 @@ void USER_APP_AUTO_RESPONDER_Parse(uint8_t *parse_buffer, uint8_t parse_buffer_s
|
|||
|
||||
sts_cfg_nvm.sts_service_mask = sts_service_mask;
|
||||
OnStoreSTSCFGContextRequest();
|
||||
i=0;
|
||||
UTIL_MEM_set_8((void*)outbuf, 0x0, sizeof(outbuf));
|
||||
UTIL_MEM_cpy_8((void*)outbuf,(void*)tlv_buf, parse_buffer_size);
|
||||
i = parse_buffer_size;
|
||||
STS_SENSOR_Upload_Message(YUNHORN_STS_USER_APP_CTRL_REPLY_PORT, i, (uint8_t *)outbuf);
|
||||
|
||||
|
||||
} else {
|
||||
sts_service_mask = STS_SERVICE_MASK_L2;
|
||||
|
@ -1375,6 +1369,12 @@ void USER_APP_AUTO_RESPONDER_Parse(uint8_t *parse_buffer, uint8_t parse_buffer_s
|
|||
sts_ac_code[19] =0x0;
|
||||
}
|
||||
|
||||
i=0;
|
||||
UTIL_MEM_set_8((void*)outbuf, 0x0, sizeof(outbuf));
|
||||
UTIL_MEM_cpy_8((void*)outbuf,(void*)tlv_buf, parse_buffer_size);
|
||||
i = parse_buffer_size;
|
||||
STS_SENSOR_Upload_Message(YUNHORN_STS_USER_APP_CTRL_REPLY_PORT, i, (uint8_t *)outbuf);
|
||||
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -1471,50 +1471,56 @@ void OnStoreSTSCFGContextRequest(void)
|
|||
{
|
||||
/* USER CODE BEGIN OnStoreContextRequest_1 */
|
||||
uint8_t i=0,j=0;
|
||||
uint8_t nvm_store_value[YUNHORN_STS_MAX_NVM_CFG_SIZE]={0x0}; /* KEEP THIS LOCAL */
|
||||
uint8_t to_store__value[YUNHORN_STS_MAX_NVM_CFG_SIZE]={0x0}; /* KEEP THIS LOCAL */
|
||||
sts_cfg_nvm.length = STS_NVM_CFG_SIZE;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.mtmcode1;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.mtmcode2;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.version;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.hardware_ver;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.periodicity;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.unit;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.sampling;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.s_unit;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.work_mode;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.sts_service_mask;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.sts_ioc_mask;
|
||||
nvm_store_value[i++] = (uint8_t) STS_CFG_PCFG_SIZE; //sts_cfg_nvm.length;
|
||||
to_store__value[i++] = sts_cfg_nvm.mtmcode1;
|
||||
to_store__value[i++] = sts_cfg_nvm.mtmcode2;
|
||||
to_store__value[i++] = sts_cfg_nvm.version;
|
||||
to_store__value[i++] = sts_cfg_nvm.hardware_ver;
|
||||
to_store__value[i++] = sts_cfg_nvm.periodicity;
|
||||
to_store__value[i++] = sts_cfg_nvm.unit;
|
||||
to_store__value[i++] = sts_cfg_nvm.sampling;
|
||||
to_store__value[i++] = sts_cfg_nvm.s_unit;
|
||||
to_store__value[i++] = sts_cfg_nvm.work_mode;
|
||||
to_store__value[i++] = sts_cfg_nvm.sts_service_mask;
|
||||
to_store__value[i++] = sts_cfg_nvm.sts_ioc_mask;
|
||||
to_store__value[i++] = (uint8_t) STS_CFG_PCFG_SIZE; //sts_cfg_nvm.length;
|
||||
|
||||
for (j = 0; j < STS_CFG_PCFG_SIZE; j++) {
|
||||
nvm_store_value[i++] = (sts_cfg_nvm.p[j]);
|
||||
to_store__value[i++] = (sts_cfg_nvm.p[j]);
|
||||
}
|
||||
|
||||
nvm_store_value[i++] = sts_cfg_nvm.reserve02;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.reserve03;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.sensor_install_height_in_10cm;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.alarm_parameter05;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.alarm_mute_reset_timer_in_10sec;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.alarm_lamp_bar_flashing_color;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.occupancy_overtime_threshold_in_10min;
|
||||
to_store__value[i++] = sts_cfg_nvm.reserve02;
|
||||
to_store__value[i++] = sts_cfg_nvm.reserve03;
|
||||
to_store__value[i++] = sts_cfg_nvm.sensor_install_height_in_10cm;
|
||||
to_store__value[i++] = sts_cfg_nvm.alarm_parameter05;
|
||||
to_store__value[i++] = sts_cfg_nvm.alarm_mute_reset_timer_in_10sec;
|
||||
to_store__value[i++] = sts_cfg_nvm.alarm_lamp_bar_flashing_color;
|
||||
to_store__value[i++] = sts_cfg_nvm.occupancy_overtime_threshold_in_10min;
|
||||
|
||||
nvm_store_value[i++] = sts_cfg_nvm.motionless_duration_threshold_in_min;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.unconscious_or_motionless_level_threshold;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.fall_detection_acc_threshold;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.fall_detection_depth_threshold;
|
||||
nvm_store_value[i++] = sts_cfg_nvm.fall_confirm_threshold_in_10sec;
|
||||
to_store__value[i++] = sts_cfg_nvm.motionless_duration_threshold_in_min;
|
||||
to_store__value[i++] = sts_cfg_nvm.unconscious_or_motionless_level_threshold;
|
||||
to_store__value[i++] = sts_cfg_nvm.fall_detection_acc_threshold;
|
||||
to_store__value[i++] = sts_cfg_nvm.fall_detection_depth_threshold;
|
||||
to_store__value[i++] = sts_cfg_nvm.fall_confirm_threshold_in_10sec;
|
||||
|
||||
if ((sts_cfg_nvm.ac[0]!=0x0) && (sts_cfg_nvm.ac[19]!=0x0)) {
|
||||
for (j = 0; j < YUNHORN_STS_AC_CODE_SIZE; j++) {
|
||||
nvm_store_value[i++] = (sts_cfg_nvm.ac[j]);
|
||||
}
|
||||
if ((nvm_store_value[NVM_AC_CODE_START]!= 0x0) && (nvm_store_value[NVM_AC_CODE_START+19]!=0x0))
|
||||
{
|
||||
//APP_LOG(TS_OFF, VLEVEL_M, "\n\r Transfer good NVM Stored ac_code to NVM_STORE_VALUE\r\n");
|
||||
UTIL_MEM_cpy_8((void*)&to_store__value[NVM_AC_CODE_START], (void*)&nvm_store_value[NVM_AC_CODE_START],YUNHORN_STS_AC_CODE_SIZE);
|
||||
} else if ((sts_ac_code[0]!=0x0) && (sts_ac_code[YUNHORN_STS_AC_CODE_SIZE-1]!=0x0))
|
||||
{
|
||||
//APP_LOG(TS_OFF, VLEVEL_M, "\n\r Transfer new generated ac_code to NVM_STORE_VALUE\r\n");
|
||||
UTIL_MEM_cpy_8((void*)&to_store__value[NVM_AC_CODE_START], (void*)sts_ac_code,YUNHORN_STS_AC_CODE_SIZE);
|
||||
UTIL_MEM_cpy_8((void*)&nvm_store_value[NVM_AC_CODE_START], (void*)sts_ac_code,YUNHORN_STS_AC_CODE_SIZE);
|
||||
}
|
||||
|
||||
/* USER CODE END OnStoreContextRequest_1 */
|
||||
/* store nvm in flash */
|
||||
|
||||
if (FLASH_IF_Erase(STS_CONFIG_NVM_BASE_ADDRESS, FLASH_PAGE_SIZE) == FLASH_IF_OK)
|
||||
{
|
||||
FLASH_IF_Write(STS_CONFIG_NVM_BASE_ADDRESS, (const void *)nvm_store_value, YUNHORN_STS_MAX_NVM_CFG_SIZE);
|
||||
FLASH_IF_Write(STS_CONFIG_NVM_BASE_ADDRESS, (const void *)to_store__value, YUNHORN_STS_MAX_NVM_CFG_SIZE);
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN OnStoreContextRequest_Last */
|
||||
|
@ -1538,14 +1544,15 @@ void OnRestoreSTSCFGContextRequest(uint8_t *cfg_in_nvm)
|
|||
void STS_REBOOT_CONFIG_Init(void)
|
||||
{
|
||||
/* USER CODE BEGIN OnRestoreContextRequest_1 */
|
||||
uint8_t nvm_store_value[YUNHORN_STS_MAX_NVM_CFG_SIZE]={0x0};
|
||||
//uint8_t nvm_store_value[YUNHORN_STS_MAX_NVM_CFG_SIZE]={0x0};
|
||||
/* USER CODE END OnRestoreContextRequest_1 */
|
||||
FLASH_IF_Read(nvm_store_value, STS_CONFIG_NVM_BASE_ADDRESS, YUNHORN_STS_MAX_NVM_CFG_SIZE);
|
||||
FLASH_IF_Read((void*)nvm_store_value, (void*)STS_CONFIG_NVM_BASE_ADDRESS, YUNHORN_STS_MAX_NVM_CFG_SIZE);
|
||||
//STS_Show_STS_CFG_NVM((uint8_t*)nvm_store_value);
|
||||
/* USER CODE BEGIN OnRestoreContextRequest_Last */
|
||||
|
||||
if ((nvm_store_value[NVM_MTM1] != sts_mtmcode1) || (nvm_store_value[NVM_MTM2] != sts_mtmcode2) || (nvm_store_value[NVM_VER] != sts_version))
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\nInitial Boot with Empty Config, Flash with default config....\r\n");
|
||||
APP_LOG(TS_OFF, VLEVEL_L, "\r\nInitial Boot with Empty Config, Flash with default config....\r\n");
|
||||
OnStoreSTSCFGContextRequest();
|
||||
//UTIL_MEM_set_8((void *)sts_ac_code, 0x00, YUNHORN_STS_AC_CODE_SIZE);
|
||||
HAL_Delay(1000);
|
||||
|
@ -1609,8 +1616,7 @@ void OnRestoreSTSCFGContextProcess(void)
|
|||
APP_LOG(TS_OFF, VLEVEL_M, "\n\n Tx periodicity in NVM =%u sec\n",periodicity);
|
||||
|
||||
TxPeriodicity= periodicity*1000; // to ms
|
||||
STS_TxPeriod_sec = periodicity;
|
||||
//STS_TxPeriod_sec=10, STS_HeartBeatTimerPeriod_sec=60;
|
||||
|
||||
uint32_t sampling_heartbeat_periodicity = (sts_cfg_nvm.sampling); //Heart-beat or Sampling interval
|
||||
if ((char)sts_cfg_nvm.s_unit =='M') {
|
||||
sampling_heartbeat_periodicity *= 60;
|
||||
|
@ -1619,22 +1625,25 @@ void OnRestoreSTSCFGContextProcess(void)
|
|||
} else if ((char) sts_cfg_nvm.s_unit =='S') {
|
||||
sampling_heartbeat_periodicity *= 1;
|
||||
}
|
||||
|
||||
STS_HeartBeatTimerPeriod_sec = sampling_heartbeat_periodicity;
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\n\n sampling or heartbeat periodicity in NVM =%u sec\n",sampling_heartbeat_periodicity);
|
||||
APP_LOG(TS_OFF, VLEVEL_H, "\n\n sampling or heartbeat periodicity in NVM =%u sec\n",sampling_heartbeat_periodicity);
|
||||
|
||||
|
||||
|
||||
if ((sts_cfg_nvm.ac[0] ==0x0 )&& (sts_cfg_nvm.ac[19]==0x0))
|
||||
{ // ensure it's not in production yet
|
||||
//OnTxPeriodicityChanged(APP_TX_DUTYCYCLE); // in msec unit
|
||||
//OnYunhornSTSHeartBeatPeriodicityChanged(HeartBeatPeriodicity); TODO XXXX
|
||||
|
||||
OnYunhornSTSTxPeriodicityChanged(APP_TX_DUTYCYCLE); // in msec unit
|
||||
OnYunhornSTSHeartBeatPeriodicityChanged(APP_TX_DUTYCYCLE*5); //TODO XXXX
|
||||
|
||||
//OnTxPeriodicityChanged(10000); // APP_TX_DUTYCYCLE in msec unit
|
||||
//TxPeriodicity = APP_TX_DUTYCYCLE;
|
||||
OnYunhornSTSTxPeriodicityChanged(TxPeriodicity); // in msec unit
|
||||
OnYunhornSTSHeartBeatPeriodicityChanged(60*1000);
|
||||
TxPeriodicity = APP_TX_DUTYCYCLE;
|
||||
|
||||
} else
|
||||
{
|
||||
OnYunhornSTSTxPeriodicityChanged(TxPeriodicity); // in msec unit
|
||||
//OnTxPeriodicityChanged(periodicity*1000);
|
||||
//OnTxPeriodicityChanged(TxPeriodicity);
|
||||
//Heart-beat or Sampling interval
|
||||
//sampling_heartbeat_periodicity = (sampling_heartbeat_periodicity > 0)? sampling_heartbeat_periodicity : 1; // in seconds unit
|
||||
//sampling_heartbeat_periodicity = sampling_heartbeat_periodicity*1000;
|
||||
|
@ -1645,6 +1654,7 @@ void OnRestoreSTSCFGContextProcess(void)
|
|||
OnYunhornSTSSamplingPeriodicityChanged(sampling_heartbeat_periodicity); // in m-sec unit
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(STS_R1)||defined(STS_R5)||defined(STS_R4)||defined(STS_R1D)
|
||||
OnYunhornSTSHeartBeatPeriodicityChanged(sampling_heartbeat_periodicity*1000);
|
||||
#endif
|
||||
|
@ -1678,16 +1688,18 @@ void OnRestoreSTSCFGContextProcess(void)
|
|||
|
||||
}
|
||||
|
||||
static void STS_Show_STS_CFG_NVM(uint8_t * nvm_store_value)
|
||||
static void STS_Show_STS_CFG_NVM(uint8_t * store_value)
|
||||
{
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\n *** STS_CFG_NVM ***\n");
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\n-----------------------------------------------\n");
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\n00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15\n");
|
||||
for (uint8_t i=0; i<YUNHORN_STS_MAX_NVM_CFG_SIZE; i++)
|
||||
{
|
||||
if (i%16==0) APP_LOG(TS_OFF, VLEVEL_M, "\n");
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "%02X ", nvm_store_value[i]);
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "%02X ", store_value[i]);
|
||||
|
||||
}
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\n\r");
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\n###############################################\n\r");
|
||||
}
|
||||
void STS_SENSOR_Distance_Test_Process(void)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue