From 1266be1ae3436357ebff6febdb421bbf08dc71f9 Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Fri, 10 Nov 2023 12:57:47 +0800 Subject: [PATCH] revised for mtm-2 code to 39, disable log --- Core/Inc/yunhorn_sts_prd_conf.h | 4 ++-- LoRaWAN/App/lora_app.c | 5 +++-- TOF/App/app_tof_vl53l0x_range.c | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Core/Inc/yunhorn_sts_prd_conf.h b/Core/Inc/yunhorn_sts_prd_conf.h index 10cc030..7789c26 100644 --- a/Core/Inc/yunhorn_sts_prd_conf.h +++ b/Core/Inc/yunhorn_sts_prd_conf.h @@ -234,7 +234,7 @@ #define MajorVer 23U #define MinorVer 11U -#define SubMinorVer 02U +#define SubMinorVer 10U #define FirmwareVersion 3U #define YUNHORN_STS_MAX_NVM_CFG_SIZE 64U #define YUNHORN_STS_AC_CODE_SIZE 20U @@ -251,7 +251,7 @@ #ifdef YUNHORN_STS_R1_ENABLED #define sts_mtmcode1 0U -#define sts_mtmcode2 57U +#define sts_mtmcode2 39U #define sts_hardware_ver 1U #define sts_version 1U #define sts_senddataport (YUNHORN_STS_R1_LORA_APP_DATA_PORT) diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index eb99d50..871e3b9 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -816,7 +816,7 @@ static void SendTxData(void) #endif //r0_data.battery_Pct = batteryLevel; //(uint8_t)(99*batteryLevel/254); - EnvSensors_Read(&sensor_data); + //EnvSensors_Read(&sensor_data); // APP_LOG(TS_ON, VLEVEL_M, "\r\nVDDA: %d\r\n", batteryLevel); // APP_LOG(TS_ON, VLEVEL_M, "\r\ntemp: %d\r\n", (int16_t)(sensor_data.temperature)); @@ -838,6 +838,7 @@ static void SendTxData(void) if (heart_beat_timer != 0U) { heart_beat_timer = 0U; + AppData.Buffer[0] = AppLedStateOn|0X80; AppData.Port = LORAWAN_USER_HTBT_PORT; //LORAWAN_USER_APP_PORT+1; #ifdef ROCTEC_R5 AppData.Buffer[i++] = AppLedStateOn; @@ -1005,7 +1006,7 @@ static void OnJoinRequest(LmHandlerJoinParams_t *joinParams) OnYunhornSTSHeartBeatPeriodicityChanged(HeartBeatPeriodicity); OnTxPeriodicityChanged(TxPeriodicity); - APP_LOG(TS_OFF, VLEVEL_H,"\r\n STS_LoRa_WAN_Joined = %s \r\n", (STS_LoRa_WAN_Joined == 1)?"ABP":"OTAA"); + APP_LOG(TS_OFF, VLEVEL_L,"\r\n STS_LoRa_WAN_Joined = %s \r\n", (STS_LoRa_WAN_Joined == 1)?"ABP":"OTAA"); } else { diff --git a/TOF/App/app_tof_vl53l0x_range.c b/TOF/App/app_tof_vl53l0x_range.c index f53d5a1..4dff953 100644 --- a/TOF/App/app_tof_vl53l0x_range.c +++ b/TOF/App/app_tof_vl53l0x_range.c @@ -411,14 +411,14 @@ void STS_TOF_VL53L0X_Range_Process(void) } HAL_Delay(1); } while ((RangingMeasurementData.RangeStatus != 0)&&(rep <10)); - sts_tof_distance_data[i] = (RangingMeasurementData.RangeStatus!=0)?STS_MAX_L0_RANGE:sts_tof_distance_data[i]; + sts_tof_distance_data[i] = (RangingMeasurementData.RangeStatus!=0)?STS_MAX_L0_RANGE:VL53L0XDevs[i].LeakyRange; } HAL_Delay(5); } // for i < MAX_TOF_COUNT if (sensor_data_ready != 0) { - APP_LOG(TS_OFF, VLEVEL_H, "\r\n## Measured Range: \r\nTOF #0 = %4u mm, \r\nTOF #1 = %4u mm, \r\nTOF #2 = %4u mm\r\n", + APP_LOG(TS_OFF, VLEVEL_L, "\r\n## Measured Range: \r\nTOF #0 = %4u mm, \r\nTOF #1 = %4u mm, \r\nTOF #2 = %4u mm\r\n", (int)sts_tof_distance_data[0],(int)sts_tof_distance_data[1],(int)sts_tof_distance_data[2]); }