Skip to content

Commit

Permalink
Explicitly use empty initializer list
Browse files Browse the repository at this point in the history
Per C and CPP spec, {} will set all elements to their "static" defined
equivalents (i.e. 0).
  • Loading branch information
earlephilhower committed Nov 14, 2024
1 parent ddcaa6b commit fb62c57
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/rp2_common/hardware_pio/include/hardware/pio.h
Original file line number Diff line number Diff line change
Expand Up @@ -647,10 +647,9 @@ static inline void sm_config_set_mov_status(pio_sm_config *c, enum pio_mov_statu
* \return the default state machine configuration which can then be modified.
*/
static inline pio_sm_config pio_get_default_sm_config(void) {
#if PICO_PIO_USE_GPIO_BASE
pio_sm_config c = {0, 0, 0, 0, -1};
#else
pio_sm_config c = {0, 0, 0, 0};
pio_sm_config c = {};
#if PICO_PIO_USE_GPIO_BASE
c.pinhi = -1;
#endif
sm_config_set_clkdiv_int_frac(&c, 1, 0);
sm_config_set_wrap(&c, 0, 31);
Expand Down

0 comments on commit fb62c57

Please sign in to comment.