Skip to content

Commit

Permalink
Improve repr of egpio pin objects
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewWilkes committed Jun 25, 2024
1 parent db20c99 commit 4a28f23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/tildagon_pin/tildagon_pin.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ gpio_num_t tildagon_pin_get_id(mp_obj_t pin_in) {

static void tildagon_pin_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
tildagon_pin_obj_t *self = self_in;
mp_printf(print, "Pin(%u)", PIN_OBJ_PTR_INDEX(self));
mp_printf(print, "ePin((%u, %u))", (PIN_OBJ_PTR_INDEX(self)/16), (PIN_OBJ_PTR_INDEX(self)%16));
}

// pin.init(mode=None, value)
Expand Down
6 changes: 3 additions & 3 deletions modules/tildagon/pins.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@

class Pin(ePin):
def __init__(self, pin_name, mode=None):
self.OUT = ePin.OUT
self.IN = ePin.IN
self.PWM = ePin.PWM
self.name = pin_name
super().__init__(HEXPANSION_GPIOS[pin_name], mode)

def __repr__(self):
return f"Pin({self.name})"

0 comments on commit 4a28f23

Please sign in to comment.