Compare commits
3 Commits
fe8d7fe99f
...
a9fc87afbc
Author | SHA1 | Date |
---|---|---|
|
a9fc87afbc | |
|
406f7a204c | |
|
bd990f7bd8 |
|
@ -1017,12 +1017,16 @@ static void ProcessRadioTxDone( void )
|
||||||
Radio.Sleep( );
|
Radio.Sleep( );
|
||||||
}
|
}
|
||||||
#if ( !defined(DISABLE_LORAWAN_RX_WINDOW) || (DISABLE_LORAWAN_RX_WINDOW == 0) )
|
#if ( !defined(DISABLE_LORAWAN_RX_WINDOW) || (DISABLE_LORAWAN_RX_WINDOW == 0) )
|
||||||
|
// Setup timers
|
||||||
// Setup timers
|
// Setup timers
|
||||||
CRITICAL_SECTION_BEGIN( );
|
CRITICAL_SECTION_BEGIN( );
|
||||||
uint32_t offset = TimerGetCurrentTime( ) - TxDoneParams.CurTime;
|
uint32_t cur_time = TimerGetCurrentTime( );
|
||||||
TimerSetValue( &MacCtx.RxWindowTimer1, MacCtx.RxWindow1Delay - offset );
|
uint32_t offset = (cur_time >= TxDoneParams.CurTime) ? (cur_time - TxDoneParams.CurTime) : (cur_time+ (0XFFFFFFFF - TxDoneParams.CurTime + 1));
|
||||||
|
uint32_t value1 = (MacCtx.RxWindow1Delay > offset) ? (MacCtx.RxWindow1Delay - offset) : MacCtx.RxWindow1Delay;
|
||||||
|
TimerSetValue( &MacCtx.RxWindowTimer1, value1 );
|
||||||
TimerStart( &MacCtx.RxWindowTimer1 );
|
TimerStart( &MacCtx.RxWindowTimer1 );
|
||||||
TimerSetValue( &MacCtx.RxWindowTimer2, MacCtx.RxWindow2Delay - offset );
|
uint32_t value2 = (MacCtx.RxWindow2Delay > offset) ? (MacCtx.RxWindow2Delay - offset) : MacCtx.RxWindow2Delay;
|
||||||
|
TimerSetValue( &MacCtx.RxWindowTimer2, value2 );
|
||||||
TimerStart( &MacCtx.RxWindowTimer2 );
|
TimerStart( &MacCtx.RxWindowTimer2 );
|
||||||
CRITICAL_SECTION_END( );
|
CRITICAL_SECTION_END( );
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -485,6 +485,7 @@ sfx_u8 RF_API_wait_for_clear_channel(sfx_u8 cs_min, sfx_s8 cs_threshold, sfx_rx_
|
||||||
{
|
{
|
||||||
sfx_u8 status = SFX_ERR_NONE;
|
sfx_u8 status = SFX_ERR_NONE;
|
||||||
sfx_rx_state_enum_t cs_state = DL_TIMEOUT;
|
sfx_rx_state_enum_t cs_state = DL_TIMEOUT;
|
||||||
|
sfx_s8 lbt_threshold_cal;
|
||||||
/* Starts Rx Windows to sense if channel is occupied or clear*
|
/* Starts Rx Windows to sense if channel is occupied or clear*
|
||||||
* If the channel is clear during the minimum carrier sense
|
* If the channel is clear during the minimum carrier sense
|
||||||
* value (cs_min), under the limit of the cs_threshold,
|
* value (cs_min), under the limit of the cs_threshold,
|
||||||
|
@ -502,6 +503,8 @@ sfx_u8 RF_API_wait_for_clear_channel(sfx_u8 cs_min, sfx_s8 cs_threshold, sfx_rx_
|
||||||
|
|
||||||
HAL_Delay(Radio.GetWakeupTime());
|
HAL_Delay(Radio.GetWakeupTime());
|
||||||
|
|
||||||
|
lbt_threshold_cal = E2P_Read_RssiCal();
|
||||||
|
cs_threshold += lbt_threshold_cal;
|
||||||
APP_LOG(TS_ON, VLEVEL_M, "CS start cs_min=%dms, cs_threshold=%dBm\n\r", cs_min, cs_threshold);
|
APP_LOG(TS_ON, VLEVEL_M, "CS start cs_min=%dms, cs_threshold=%dBm\n\r", cs_min, cs_threshold);
|
||||||
|
|
||||||
while (RxCarrierSenseGetStatus() == 0)
|
while (RxCarrierSenseGetStatus() == 0)
|
||||||
|
|
|
@ -485,6 +485,7 @@ sfx_u8 RF_API_wait_for_clear_channel(sfx_u8 cs_min, sfx_s8 cs_threshold, sfx_rx_
|
||||||
{
|
{
|
||||||
sfx_u8 status = SFX_ERR_NONE;
|
sfx_u8 status = SFX_ERR_NONE;
|
||||||
sfx_rx_state_enum_t cs_state = DL_TIMEOUT;
|
sfx_rx_state_enum_t cs_state = DL_TIMEOUT;
|
||||||
|
sfx_s8 lbt_threshold_cal;
|
||||||
/* Starts Rx Windows to sense if channel is occupied or clear*
|
/* Starts Rx Windows to sense if channel is occupied or clear*
|
||||||
* If the channel is clear during the minimum carrier sense
|
* If the channel is clear during the minimum carrier sense
|
||||||
* value (cs_min), under the limit of the cs_threshold,
|
* value (cs_min), under the limit of the cs_threshold,
|
||||||
|
@ -502,6 +503,8 @@ sfx_u8 RF_API_wait_for_clear_channel(sfx_u8 cs_min, sfx_s8 cs_threshold, sfx_rx_
|
||||||
|
|
||||||
HAL_Delay(Radio.GetWakeupTime());
|
HAL_Delay(Radio.GetWakeupTime());
|
||||||
|
|
||||||
|
lbt_threshold_cal = E2P_Read_RssiCal();
|
||||||
|
cs_threshold += lbt_threshold_cal;
|
||||||
APP_LOG(TS_ON, VLEVEL_M, "CS start cs_min=%dms, cs_threshold=%dBm\n\r", cs_min, cs_threshold);
|
APP_LOG(TS_ON, VLEVEL_M, "CS start cs_min=%dms, cs_threshold=%dBm\n\r", cs_min, cs_threshold);
|
||||||
|
|
||||||
while (RxCarrierSenseGetStatus() == 0)
|
while (RxCarrierSenseGetStatus() == 0)
|
||||||
|
|
|
@ -485,6 +485,7 @@ sfx_u8 RF_API_wait_for_clear_channel(sfx_u8 cs_min, sfx_s8 cs_threshold, sfx_rx_
|
||||||
{
|
{
|
||||||
sfx_u8 status = SFX_ERR_NONE;
|
sfx_u8 status = SFX_ERR_NONE;
|
||||||
sfx_rx_state_enum_t cs_state = DL_TIMEOUT;
|
sfx_rx_state_enum_t cs_state = DL_TIMEOUT;
|
||||||
|
sfx_s8 lbt_threshold_cal;
|
||||||
/* Starts Rx Windows to sense if channel is occupied or clear*
|
/* Starts Rx Windows to sense if channel is occupied or clear*
|
||||||
* If the channel is clear during the minimum carrier sense
|
* If the channel is clear during the minimum carrier sense
|
||||||
* value (cs_min), under the limit of the cs_threshold,
|
* value (cs_min), under the limit of the cs_threshold,
|
||||||
|
@ -502,6 +503,8 @@ sfx_u8 RF_API_wait_for_clear_channel(sfx_u8 cs_min, sfx_s8 cs_threshold, sfx_rx_
|
||||||
|
|
||||||
HAL_Delay(Radio.GetWakeupTime());
|
HAL_Delay(Radio.GetWakeupTime());
|
||||||
|
|
||||||
|
lbt_threshold_cal = E2P_Read_RssiCal();
|
||||||
|
cs_threshold += lbt_threshold_cal;
|
||||||
APP_LOG(TS_ON, VLEVEL_M, "CS start cs_min=%dms, cs_threshold=%dBm\n\r", cs_min, cs_threshold);
|
APP_LOG(TS_ON, VLEVEL_M, "CS start cs_min=%dms, cs_threshold=%dBm\n\r", cs_min, cs_threshold);
|
||||||
|
|
||||||
while (RxCarrierSenseGetStatus() == 0)
|
while (RxCarrierSenseGetStatus() == 0)
|
||||||
|
|
|
@ -485,6 +485,7 @@ sfx_u8 RF_API_wait_for_clear_channel(sfx_u8 cs_min, sfx_s8 cs_threshold, sfx_rx_
|
||||||
{
|
{
|
||||||
sfx_u8 status = SFX_ERR_NONE;
|
sfx_u8 status = SFX_ERR_NONE;
|
||||||
sfx_rx_state_enum_t cs_state = DL_TIMEOUT;
|
sfx_rx_state_enum_t cs_state = DL_TIMEOUT;
|
||||||
|
sfx_s8 lbt_threshold_cal;
|
||||||
/* Starts Rx Windows to sense if channel is occupied or clear*
|
/* Starts Rx Windows to sense if channel is occupied or clear*
|
||||||
* If the channel is clear during the minimum carrier sense
|
* If the channel is clear during the minimum carrier sense
|
||||||
* value (cs_min), under the limit of the cs_threshold,
|
* value (cs_min), under the limit of the cs_threshold,
|
||||||
|
@ -502,6 +503,8 @@ sfx_u8 RF_API_wait_for_clear_channel(sfx_u8 cs_min, sfx_s8 cs_threshold, sfx_rx_
|
||||||
|
|
||||||
HAL_Delay(Radio.GetWakeupTime());
|
HAL_Delay(Radio.GetWakeupTime());
|
||||||
|
|
||||||
|
lbt_threshold_cal = E2P_Read_RssiCal();
|
||||||
|
cs_threshold += lbt_threshold_cal;
|
||||||
APP_LOG(TS_ON, VLEVEL_M, "CS start cs_min=%dms, cs_threshold=%dBm\n\r", cs_min, cs_threshold);
|
APP_LOG(TS_ON, VLEVEL_M, "CS start cs_min=%dms, cs_threshold=%dBm\n\r", cs_min, cs_threshold);
|
||||||
|
|
||||||
while (RxCarrierSenseGetStatus() == 0)
|
while (RxCarrierSenseGetStatus() == 0)
|
||||||
|
|
|
@ -485,6 +485,7 @@ sfx_u8 RF_API_wait_for_clear_channel(sfx_u8 cs_min, sfx_s8 cs_threshold, sfx_rx_
|
||||||
{
|
{
|
||||||
sfx_u8 status = SFX_ERR_NONE;
|
sfx_u8 status = SFX_ERR_NONE;
|
||||||
sfx_rx_state_enum_t cs_state = DL_TIMEOUT;
|
sfx_rx_state_enum_t cs_state = DL_TIMEOUT;
|
||||||
|
sfx_s8 lbt_threshold_cal;
|
||||||
/* Starts Rx Windows to sense if channel is occupied or clear*
|
/* Starts Rx Windows to sense if channel is occupied or clear*
|
||||||
* If the channel is clear during the minimum carrier sense
|
* If the channel is clear during the minimum carrier sense
|
||||||
* value (cs_min), under the limit of the cs_threshold,
|
* value (cs_min), under the limit of the cs_threshold,
|
||||||
|
@ -502,6 +503,8 @@ sfx_u8 RF_API_wait_for_clear_channel(sfx_u8 cs_min, sfx_s8 cs_threshold, sfx_rx_
|
||||||
|
|
||||||
HAL_Delay(Radio.GetWakeupTime());
|
HAL_Delay(Radio.GetWakeupTime());
|
||||||
|
|
||||||
|
lbt_threshold_cal = E2P_Read_RssiCal();
|
||||||
|
cs_threshold += lbt_threshold_cal;
|
||||||
APP_LOG(TS_ON, VLEVEL_M, "CS start cs_min=%dms, cs_threshold=%dBm\n\r", cs_min, cs_threshold);
|
APP_LOG(TS_ON, VLEVEL_M, "CS start cs_min=%dms, cs_threshold=%dBm\n\r", cs_min, cs_threshold);
|
||||||
|
|
||||||
while (RxCarrierSenseGetStatus() == 0)
|
while (RxCarrierSenseGetStatus() == 0)
|
||||||
|
|
|
@ -485,6 +485,7 @@ sfx_u8 RF_API_wait_for_clear_channel(sfx_u8 cs_min, sfx_s8 cs_threshold, sfx_rx_
|
||||||
{
|
{
|
||||||
sfx_u8 status = SFX_ERR_NONE;
|
sfx_u8 status = SFX_ERR_NONE;
|
||||||
sfx_rx_state_enum_t cs_state = DL_TIMEOUT;
|
sfx_rx_state_enum_t cs_state = DL_TIMEOUT;
|
||||||
|
sfx_s8 lbt_threshold_cal;
|
||||||
/* Starts Rx Windows to sense if channel is occupied or clear*
|
/* Starts Rx Windows to sense if channel is occupied or clear*
|
||||||
* If the channel is clear during the minimum carrier sense
|
* If the channel is clear during the minimum carrier sense
|
||||||
* value (cs_min), under the limit of the cs_threshold,
|
* value (cs_min), under the limit of the cs_threshold,
|
||||||
|
@ -502,6 +503,8 @@ sfx_u8 RF_API_wait_for_clear_channel(sfx_u8 cs_min, sfx_s8 cs_threshold, sfx_rx_
|
||||||
|
|
||||||
HAL_Delay(Radio.GetWakeupTime());
|
HAL_Delay(Radio.GetWakeupTime());
|
||||||
|
|
||||||
|
lbt_threshold_cal = E2P_Read_RssiCal();
|
||||||
|
cs_threshold += lbt_threshold_cal;
|
||||||
APP_LOG(TS_ON, VLEVEL_M, "CS start cs_min=%dms, cs_threshold=%dBm\n\r", cs_min, cs_threshold);
|
APP_LOG(TS_ON, VLEVEL_M, "CS start cs_min=%dms, cs_threshold=%dBm\n\r", cs_min, cs_threshold);
|
||||||
|
|
||||||
while (RxCarrierSenseGetStatus() == 0)
|
while (RxCarrierSenseGetStatus() == 0)
|
||||||
|
|
|
@ -485,6 +485,7 @@ sfx_u8 RF_API_wait_for_clear_channel(sfx_u8 cs_min, sfx_s8 cs_threshold, sfx_rx_
|
||||||
{
|
{
|
||||||
sfx_u8 status = SFX_ERR_NONE;
|
sfx_u8 status = SFX_ERR_NONE;
|
||||||
sfx_rx_state_enum_t cs_state = DL_TIMEOUT;
|
sfx_rx_state_enum_t cs_state = DL_TIMEOUT;
|
||||||
|
sfx_s8 lbt_threshold_cal;
|
||||||
/* Starts Rx Windows to sense if channel is occupied or clear*
|
/* Starts Rx Windows to sense if channel is occupied or clear*
|
||||||
* If the channel is clear during the minimum carrier sense
|
* If the channel is clear during the minimum carrier sense
|
||||||
* value (cs_min), under the limit of the cs_threshold,
|
* value (cs_min), under the limit of the cs_threshold,
|
||||||
|
@ -502,6 +503,8 @@ sfx_u8 RF_API_wait_for_clear_channel(sfx_u8 cs_min, sfx_s8 cs_threshold, sfx_rx_
|
||||||
|
|
||||||
HAL_Delay(Radio.GetWakeupTime());
|
HAL_Delay(Radio.GetWakeupTime());
|
||||||
|
|
||||||
|
lbt_threshold_cal = E2P_Read_RssiCal();
|
||||||
|
cs_threshold += lbt_threshold_cal;
|
||||||
APP_LOG(TS_ON, VLEVEL_M, "CS start cs_min=%dms, cs_threshold=%dBm\n\r", cs_min, cs_threshold);
|
APP_LOG(TS_ON, VLEVEL_M, "CS start cs_min=%dms, cs_threshold=%dBm\n\r", cs_min, cs_threshold);
|
||||||
|
|
||||||
while (RxCarrierSenseGetStatus() == 0)
|
while (RxCarrierSenseGetStatus() == 0)
|
||||||
|
|
Loading…
Reference in New Issue