Skip to content

Commit

Permalink
use consistent with sdk naming skeep for new cyw43_driver method... f…
Browse files Browse the repository at this point in the history
…ix build
  • Loading branch information
kilograham committed Sep 11, 2024
1 parent b5e41b3 commit 40503a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/rp2_common/hardware_pwm/include/hardware/pwm.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ static inline void pwm_config_set_clkdiv_int_frac(pwm_config *c, uint8_t div_int
*/
static inline void pwm_config_set_clkdiv_int(pwm_config *c, uint div) {
valid_params_if(HARDWARE_PWM, div >= 1 && div < 256);
pwm_config_set_clkdiv_int_frac8(c, (uint8_t)div, 0);
pwm_config_set_clkdiv_int_frac4(c, (uint8_t)div, 0);
}

/** \brief Set PWM counting mode in a PWM configuration
Expand Down Expand Up @@ -463,7 +463,7 @@ static inline void pwm_set_clkdiv(uint slice_num, float divider) {
valid_params_if(HARDWARE_PWM, divider >= 1.f && divider < 256.f);
uint8_t i = (uint8_t)divider;
uint8_t f = (uint8_t)((divider - i) * (0x01 << 4));
pwm_set_clkdiv_int_frac8(slice_num, i, f);
pwm_set_clkdiv_int_frac4(slice_num, i, f);
}

/** \brief Set PWM output polarity
Expand Down
2 changes: 1 addition & 1 deletion src/rp2_common/pico_cyw43_driver/cyw43_bus_pio_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
static uint16_t cyw43_pio_clock_div_int = CYW43_PIO_CLOCK_DIV_INT;
static uint8_t cyw43_pio_clock_div_frac8 = CYW43_PIO_CLOCK_DIV_FRAC8;

void cyw43_set_pio_clock_divisor(uint16_t clock_div_int, uint8_t clock_div_frac8) {
void cyw43_set_pio_clkdiv_int_frac8(uint16_t clock_div_int, uint8_t clock_div_frac8) {
cyw43_pio_clock_div_int = clock_div_int;
cyw43_pio_clock_div_frac8 = clock_div_frac8;
}
Expand Down
6 changes: 4 additions & 2 deletions src/rp2_common/pico_cyw43_driver/include/pico/cyw43_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ void cyw43_driver_deinit(struct async_context *context);
#endif

#if CYW43_PIO_CLOCK_DIV_DYNAMIC
void cyw43_set_pio_clock_divider_int_frac8(uint16_t clock_div_int, uint8_t clock_div_frac8);
void cyw43_set_pio_clkdiv_int_frac8(uint16_t clock_div_int, uint8_t clock_div_frac8);

// backwards compatibility
static inline void cyw43_set_pio_clock_divisor(uint16_t clock_div_int, uint8_t clock_div_frac8) {
return cyw43_set_pio_clock_divider_int_frac8(clock_div_int, clock_div_frac8);
return cyw43_set_pio_clkdiv_int_frac8(clock_div_int, clock_div_frac8);
}
#endif

Expand Down

0 comments on commit 40503a9

Please sign in to comment.