LoRaPHY: Pass frequency set in rx_config() to caller

In AU/CN/US PHY, RX1 slot frequency is calculated in rx_config().
Since the caller is printing it to log, modify the frequency in
parameter structure so that the correct value will be printed.
pull/10867/head
Teijo Kinnunen 2019-06-19 14:24:21 +03:00
parent aa9bd486d5
commit feb19eb035
3 changed files with 6 additions and 0 deletions

View File

@ -355,6 +355,8 @@ bool LoRaPHYAU915::rx_config(rx_config_params_t *params)
// Apply window 1 frequency
frequency = AU915_FIRST_RX1_CHANNEL
+ (params->channel % 8) * AU915_STEPWIDTH_RX1_CHANNEL;
// Caller may print the frequency to log so update it to match actual frequency
params->frequency = frequency;
}
// Read the physical datarate from the datarates table

View File

@ -377,6 +377,8 @@ bool LoRaPHYCN470::rx_config(rx_config_params_t *config)
if (config->rx_slot == RX_SLOT_WIN_1) {
// Apply window 1 frequency
frequency = CN470_FIRST_RX1_CHANNEL + (config->channel % 48) * CN470_STEPWIDTH_RX1_CHANNEL;
// Caller may print the frequency to log so update it to match actual frequency
config->frequency = frequency;
}
// Read the physical datarate from the datarates table

View File

@ -374,6 +374,8 @@ bool LoRaPHYUS915::rx_config(rx_config_params_t *config)
if (config->rx_slot == RX_SLOT_WIN_1) {
// Apply window 1 frequency
frequency = US915_FIRST_RX1_CHANNEL + (config->channel % 8) * US915_STEPWIDTH_RX1_CHANNEL;
// Caller may print the frequency to log so update it to match actual frequency
config->frequency = frequency;
}
// Read the physical datarate from the datarates table