Skip to content

Commit

Permalink
codal_port: Update P9 to be UNUSED on V2 (was shared on V1).
Browse files Browse the repository at this point in the history
P9 is a spare pin on micro:bit V2, but was shared with the display on V1.

This commit updates the definition of the pin and stops the display from
trying to acquire/release it during enable/disable.

Full pinout is available https://tech.microbit.org/hardware/edgeconnector/

See #57
  • Loading branch information
jaustin authored and dpgeorge committed Feb 17, 2021
1 parent ab8cff4 commit a94e53d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/codal_port/microbit_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ mp_obj_t microbit_display_on_func(mp_obj_t self_in) {
microbit_obj_pin_acquire(&microbit_p4_obj, microbit_pin_mode_display);
microbit_obj_pin_acquire(&microbit_p6_obj, microbit_pin_mode_display);
microbit_obj_pin_acquire(&microbit_p7_obj, microbit_pin_mode_display);
microbit_obj_pin_acquire(&microbit_p9_obj, microbit_pin_mode_display);
microbit_obj_pin_acquire(&microbit_p10_obj, microbit_pin_mode_display);
microbit_display_init();
self->active = true;
Expand All @@ -145,7 +144,6 @@ mp_obj_t microbit_display_off_func(mp_obj_t self_in) {
microbit_obj_pin_free(&microbit_p4_obj);
microbit_obj_pin_free(&microbit_p6_obj);
microbit_obj_pin_free(&microbit_p7_obj);
microbit_obj_pin_free(&microbit_p9_obj);
microbit_obj_pin_free(&microbit_p10_obj);
return mp_const_none;
}
Expand Down
2 changes: 1 addition & 1 deletion src/codal_port/microbit_pin.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const microbit_pin_obj_t microbit_p5_obj = {{&microbit_dig_pin_type}, 5, MICR
const microbit_pin_obj_t microbit_p6_obj = {{&microbit_dig_pin_type}, 6, MICROBIT_HAL_PIN_P6, MODE_DISPLAY};
const microbit_pin_obj_t microbit_p7_obj = {{&microbit_dig_pin_type}, 7, MICROBIT_HAL_PIN_P7, MODE_DISPLAY};
const microbit_pin_obj_t microbit_p8_obj = {{&microbit_dig_pin_type}, 8, MICROBIT_HAL_PIN_P8, MODE_UNUSED};
const microbit_pin_obj_t microbit_p9_obj = {{&microbit_dig_pin_type}, 9, MICROBIT_HAL_PIN_P9, MODE_DISPLAY};
const microbit_pin_obj_t microbit_p9_obj = {{&microbit_dig_pin_type}, 9, MICROBIT_HAL_PIN_P9, MODE_UNUSED};
const microbit_pin_obj_t microbit_p10_obj = {{&microbit_ad_pin_type}, 10, MICROBIT_HAL_PIN_P10, MODE_DISPLAY};
const microbit_pin_obj_t microbit_p11_obj = {{&microbit_dig_pin_type}, 11, MICROBIT_HAL_PIN_P11, MODE_BUTTON};
const microbit_pin_obj_t microbit_p12_obj = {{&microbit_dig_pin_type}, 12, MICROBIT_HAL_PIN_P12, MODE_UNUSED};
Expand Down

0 comments on commit a94e53d

Please sign in to comment.