Skip to content

Commit 3d8c75f

Browse files
committed
fixed formatting
1 parent c5e9b89 commit 3d8c75f

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

ports/raspberrypi/boards/pimoroni_badger2350/board.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static const uint8_t _sw_pin_nrs[] = {
4141

4242
// Mask of all front button pins
4343
#define SW_MASK ((1 << SW_A_PIN) | (1 << SW_B_PIN) | (1 << SW_C_PIN) | \
44-
(1 << SW_DOWN_PIN) | (1 << SW_UP_PIN))
44+
(1 << SW_DOWN_PIN) | (1 << SW_UP_PIN))
4545

4646
// This function runs BEFORE main() via constructor attribute!
4747
// This is the key to fast button state detection.
@@ -50,38 +50,38 @@ static const uint8_t _sw_pin_nrs[] = {
5050
static void preinit_button_state(void) {
5151
// Configure button pins as inputs with pull-downs using direct register access
5252
// This is faster than SDK functions and works before full init
53-
53+
5454
for (size_t i = 0; i < sizeof(_sw_pin_nrs); i++) {
5555
uint8_t pin_nr = _sw_pin_nrs[i];
5656
// Set as input
5757
sio_hw->gpio_oe_clr = 1u << pin_nr;
5858
// enable pull-ups
59-
pads_bank0_hw->io[pin_nr] = PADS_BANK0_GPIO0_IE_BITS |
60-
PADS_BANK0_GPIO0_PUE_BITS;
59+
pads_bank0_hw->io[pin_nr] = PADS_BANK0_GPIO0_IE_BITS |
60+
PADS_BANK0_GPIO0_PUE_BITS;
6161
// Set GPIO function
6262
iobank0_hw->io[pin_nr].ctrl = 5; // SIO function
6363
}
64-
64+
6565
// Small delay for pins to settle (just a few cycles)
6666
for (volatile int i = 0; i < 100; i++) {
6767
__asm volatile ("nop");
6868
}
69-
69+
7070
// Capture button states NOW - before anything else runs
7171
reset_button_state = ~sio_hw->gpio_in & SW_MASK;
7272
}
7373

7474
static mp_obj_t _get_reset_state(void) {
75-
return mp_obj_new_int(reset_button_state);
75+
return mp_obj_new_int(reset_button_state);
7676
}
77-
MP_DEFINE_CONST_FUN_OBJ_0(get_reset_state_obj,_get_reset_state);
77+
MP_DEFINE_CONST_FUN_OBJ_0(get_reset_state_obj, _get_reset_state);
7878

7979
static mp_obj_t _on_reset_pressed(mp_obj_t pin_in) {
80-
mcu_pin_obj_t *pin = MP_OBJ_TO_PTR(pin_in);
81-
return mp_obj_new_bool(
82-
(reset_button_state & (1<<pin->number)) != 0);
80+
mcu_pin_obj_t *pin = MP_OBJ_TO_PTR(pin_in);
81+
return mp_obj_new_bool(
82+
(reset_button_state & (1 << pin->number)) != 0);
8383
}
84-
MP_DEFINE_CONST_FUN_OBJ_1(on_reset_pressed_obj,_on_reset_pressed);
84+
MP_DEFINE_CONST_FUN_OBJ_1(on_reset_pressed_obj, _on_reset_pressed);
8585

8686
// The display uses an SSD1680 control chip.
8787
uint8_t _start_sequence[] = {
@@ -144,15 +144,15 @@ const uint8_t _refresh_sequence[] = {
144144
#define SPEED_OFFSET_3 124
145145

146146
static mp_obj_t _set_update_speed(mp_obj_t speed_in) {
147-
mp_int_t speed = mp_obj_get_int(speed_in);
148-
uint8_t count = (uint8_t)3 - (uint8_t)(speed & 3);
149-
_start_sequence[SPEED_OFFSET_1] = count;
150-
_start_sequence[SPEED_OFFSET_2] = count;
151-
_start_sequence[SPEED_OFFSET_3] = count;
152-
return mp_const_none;
147+
mp_int_t speed = mp_obj_get_int(speed_in);
148+
uint8_t count = (uint8_t)3 - (uint8_t)(speed & 3);
149+
_start_sequence[SPEED_OFFSET_1] = count;
150+
_start_sequence[SPEED_OFFSET_2] = count;
151+
_start_sequence[SPEED_OFFSET_3] = count;
152+
return mp_const_none;
153153
}
154154

155-
MP_DEFINE_CONST_FUN_OBJ_1(set_update_speed_obj,_set_update_speed);
155+
MP_DEFINE_CONST_FUN_OBJ_1(set_update_speed_obj, _set_update_speed);
156156

157157
void board_init(void) {
158158
// Drive the I2C_POWER_EN pin high

ports/raspberrypi/boards/pimoroni_badger2350/pins.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
2525
MP_QSTR_display,
2626
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS | ~MP_TYPE_FLAG_BINDS_SELF,
2727
locals_dict, &lut_update_dict
28-
);
28+
);
2929

3030
static const mp_rom_map_elem_t board_module_globals_table[] = {
3131
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS

0 commit comments

Comments
 (0)