mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
Call spiCalculateDivider() to allow validation as per ledvinap comment
This commit is contained in:
parent
4aab87539f
commit
70e22b61c4
2 changed files with 6 additions and 7 deletions
|
@ -395,21 +395,20 @@ max7456InitStatus_e max7456Init(const max7456Config_t *max7456Config, const vcdP
|
|||
}
|
||||
|
||||
#if defined(USE_OVERCLOCK)
|
||||
max7456SpiClockDiv = spiCalculateDivider(MAX7456_MAX_SPI_CLK_HZ);
|
||||
|
||||
// Determine SPI clock divisor based on config and the device type.
|
||||
|
||||
switch (max7456Config->clockConfig) {
|
||||
case MAX7456_CLOCK_CONFIG_HALF:
|
||||
max7456SpiClockDiv <<= 1;
|
||||
max7456SpiClockDiv = spiCalculateDivider(MAX7456_MAX_SPI_CLK_HZ / 2);
|
||||
break;
|
||||
|
||||
case MAX7456_CLOCK_CONFIG_NOMINAL:
|
||||
default:
|
||||
max7456SpiClockDiv = spiCalculateDivider(MAX7456_MAX_SPI_CLK_HZ);
|
||||
break;
|
||||
|
||||
case MAX7456_CLOCK_CONFIG_DOUBLE:
|
||||
max7456SpiClockDiv >>= 1;
|
||||
max7456SpiClockDiv = spiCalculateDivider(MAX7456_MAX_SPI_CLK_HZ * 2);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -840,15 +840,15 @@ bool expressLrsSpiInit(const struct rxSpiConfig_s *rxConfig, struct rxRuntimeSta
|
|||
}
|
||||
|
||||
rxSpiCommonIOInit(rxConfig);
|
||||
|
||||
|
||||
rxRuntimeState->channelCount = ELRS_MAX_CHANNELS;
|
||||
|
||||
|
||||
extiConfig->ioConfig = IOCFG_IPD;
|
||||
extiConfig->trigger = BETAFLIGHT_EXTI_TRIGGER_RISING;
|
||||
|
||||
if (rxExpressLrsSpiConfig()->resetIoTag) {
|
||||
receiver.resetPin = IOGetByTag(rxExpressLrsSpiConfig()->resetIoTag);
|
||||
} else {
|
||||
} else {
|
||||
receiver.resetPin = IO_NONE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue