File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -172,9 +172,12 @@ static inline uint32_t get_nrf_spim_frequency(uint32_t frequency)
172172{
173173 /* Get the highest supported frequency not exceeding the requested one.
174174 */
175- if (frequency >= MHZ (32 ) && (NRF_SPIM_HAS_32_MHZ_FREQ || NRF_SPIM_HAS_PRESCALER )) {
175+ #if (NRF_SPIM_HAS_PRESCALER )
176+ return frequency ;
177+ #else
178+ if (frequency >= MHZ (32 ) && NRF_SPIM_HAS_32_MHZ_FREQ ) {
176179 return MHZ (32 );
177- } else if (frequency >= MHZ (16 ) && ( NRF_SPIM_HAS_16_MHZ_FREQ || NRF_SPIM_HAS_PRESCALER ) ) {
180+ } else if (frequency >= MHZ (16 ) && NRF_SPIM_HAS_16_MHZ_FREQ ) {
178181 return MHZ (16 );
179182 } else if (frequency >= MHZ (8 )) {
180183 return MHZ (8 );
@@ -191,6 +194,8 @@ static inline uint32_t get_nrf_spim_frequency(uint32_t frequency)
191194 } else {
192195 return KHZ (125 );
193196 }
197+ #endif // NRF_SPIM_HAS_PRESCALER
198+
194199}
195200
196201static inline nrf_spim_mode_t get_nrf_spim_mode (uint16_t operation )
You can’t perform that action at this time.
0 commit comments