--- try disable ADC for temp and BAT voltage
This commit is contained in:
parent
718c6e4698
commit
51db61b31d
|
@ -77,7 +77,7 @@ void MX_DMA_Init(void)
|
||||||
HAL_NVIC_SetPriority(DMA1_Channel6_IRQn, 0, 0);
|
HAL_NVIC_SetPriority(DMA1_Channel6_IRQn, 0, 0);
|
||||||
HAL_NVIC_EnableIRQ(DMA1_Channel6_IRQn);
|
HAL_NVIC_EnableIRQ(DMA1_Channel6_IRQn);
|
||||||
#endif
|
#endif
|
||||||
#if 1
|
#if 0
|
||||||
/* DMA1_Channel7_IRQn interrupt configuration */
|
/* DMA1_Channel7_IRQn interrupt configuration */
|
||||||
HAL_NVIC_SetPriority(DMA1_Channel7_IRQn, 2, 0);
|
HAL_NVIC_SetPriority(DMA1_Channel7_IRQn, 2, 0);
|
||||||
HAL_NVIC_EnableIRQ(DMA1_Channel7_IRQn);
|
HAL_NVIC_EnableIRQ(DMA1_Channel7_IRQn);
|
||||||
|
|
|
@ -229,7 +229,8 @@ void MX_GPIO_Init(void)
|
||||||
HAL_GPIO_WritePin(TOF_L_XSHUT_GPIO_Port, TOF_L_XSHUT_Pin, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(TOF_L_XSHUT_GPIO_Port, TOF_L_XSHUT_Pin, GPIO_PIN_SET);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
HAL_GPIO_WritePin(MEMS_POWER_GPIO_Port, MEMS_POWER_Pin, GPIO_PIN_SET);
|
//HAL_GPIO_WritePin(MEMS_POWER_GPIO_Port, MEMS_POWER_Pin, GPIO_PIN_SET);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
__HAL_RCC_GPIOB_CLK_DISABLE();
|
__HAL_RCC_GPIOB_CLK_DISABLE();
|
||||||
__HAL_RCC_GPIOA_CLK_DISABLE();
|
__HAL_RCC_GPIOA_CLK_DISABLE();
|
||||||
|
|
|
@ -110,29 +110,9 @@ int main(void)
|
||||||
MX_GPIO_Init();
|
MX_GPIO_Init();
|
||||||
HAL_UART_DeInit(&huart2);
|
HAL_UART_DeInit(&huart2);
|
||||||
MX_DMA_Init();
|
MX_DMA_Init();
|
||||||
|
|
||||||
MX_I2C2_Init();
|
MX_I2C2_Init();
|
||||||
//MX_LoRaWAN_Init();
|
MX_LoRaWAN_Init();
|
||||||
//LED_ON;
|
|
||||||
//HAL_Delay(200);
|
|
||||||
//LED_OFF;
|
|
||||||
#if 1
|
|
||||||
if(__HAL_PWR_GET_FLAG(PWR_FLAG_SB) == RESET)
|
|
||||||
{
|
|
||||||
//LED_ON;
|
|
||||||
MX_LoRaWAN_Init();
|
|
||||||
//LED_OFF;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LED_ON;
|
|
||||||
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
|
|
||||||
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
|
|
||||||
//__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WPVD);
|
|
||||||
HAL_Delay(2000);
|
|
||||||
//SystemApp_Init();
|
|
||||||
LED_OFF;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
/* USER CODE BEGIN 2 */
|
/* USER CODE BEGIN 2 */
|
||||||
|
|
||||||
/* USER CODE END 2 */
|
/* USER CODE END 2 */
|
||||||
|
|
|
@ -95,14 +95,14 @@ void PWR_ExitOffMode(void)
|
||||||
void PWR_EnterStopMode(void)
|
void PWR_EnterStopMode(void)
|
||||||
{
|
{
|
||||||
/* USER CODE BEGIN EnterStopMode_1 */
|
/* USER CODE BEGIN EnterStopMode_1 */
|
||||||
#if 1
|
#if 0
|
||||||
HAL_UART_DeInit(&huart2);
|
HAL_UART_DeInit(&huart2);
|
||||||
vcom_DeInit();
|
vcom_DeInit();
|
||||||
HAL_GPIO_DeInit(GPIOA,GPIO_PIN_All);
|
HAL_GPIO_DeInit(GPIOA,GPIO_PIN_All);
|
||||||
HAL_GPIO_DeInit(GPIOB,GPIO_PIN_All);
|
HAL_GPIO_DeInit(GPIOB,GPIO_PIN_All);
|
||||||
HAL_GPIO_DeInit(GPIOC,GPIO_PIN_All);
|
HAL_GPIO_DeInit(GPIOC,GPIO_PIN_All);
|
||||||
#endif
|
#endif
|
||||||
#if 0
|
#if 1
|
||||||
HAL_UART_DeInit(&huart2);
|
HAL_UART_DeInit(&huart2);
|
||||||
vcom_DeInit();
|
vcom_DeInit();
|
||||||
|
|
||||||
|
|
|
@ -784,9 +784,9 @@ static void SendTxData(void)
|
||||||
{
|
{
|
||||||
/* USER CODE BEGIN SendTxData_1 */
|
/* USER CODE BEGIN SendTxData_1 */
|
||||||
LmHandlerErrorStatus_t status = LORAMAC_HANDLER_ERROR;
|
LmHandlerErrorStatus_t status = LORAMAC_HANDLER_ERROR;
|
||||||
uint8_t batteryLevel = GetBatteryLevel();
|
uint8_t batteryLevel = 250; //GetBatteryLevel();
|
||||||
//uint16_t batteryLevelmV = SYS_GetBatteryLevel();
|
//uint16_t batteryLevelmV = SYS_GetBatteryLevel();
|
||||||
uint16_t batteryLevelmV = STS_GetBatteryLevel();
|
uint16_t batteryLevelmV = 3000; //STS_GetBatteryLevel();
|
||||||
//sensor_t sensor_data;
|
//sensor_t sensor_data;
|
||||||
#if defined(YUNHORN_STS_R0_ENABLED)||defined(YUNHORN_STS_R5_ENABLED)
|
#if defined(YUNHORN_STS_R0_ENABLED)||defined(YUNHORN_STS_R5_ENABLED)
|
||||||
STS_R0_SensorDataTypeDef r0_data;
|
STS_R0_SensorDataTypeDef r0_data;
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue