Skip to content
Snippets Groups Projects
Commit a589fa3e authored by Dave Hylands's avatar Dave Hylands Committed by Damien George
Browse files

stmhal: Update pin print to print new constants

This updates the print function for machine.Pin to
print out the new constants from the Hardware API defintion
rather than the legacy definitions.
parent d09b6b9a
No related branches found
No related tags found
No related merge requests found
...@@ -199,15 +199,15 @@ STATIC void pin_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t ...@@ -199,15 +199,15 @@ STATIC void pin_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t
if (mode == GPIO_MODE_INPUT) { if (mode == GPIO_MODE_INPUT) {
mode_qst = MP_QSTR_IN; mode_qst = MP_QSTR_IN;
} else if (mode == GPIO_MODE_OUTPUT_PP) { } else if (mode == GPIO_MODE_OUTPUT_PP) {
mode_qst = MP_QSTR_OUT_PP; mode_qst = MP_QSTR_OUT;
} else if (mode == GPIO_MODE_OUTPUT_OD) { } else if (mode == GPIO_MODE_OUTPUT_OD) {
mode_qst = MP_QSTR_OUT_OD; mode_qst = MP_QSTR_OPEN_DRAIN;
} else { } else {
af = true; af = true;
if (mode == GPIO_MODE_AF_PP) { if (mode == GPIO_MODE_AF_PP) {
mode_qst = MP_QSTR_AF_PP; mode_qst = MP_QSTR_ALT;
} else { } else {
mode_qst = MP_QSTR_AF_OD; mode_qst = MP_QSTR_ALT_OPEN_DRAIN;
} }
} }
mp_print_str(print, qstr_str(mode_qst)); mp_print_str(print, qstr_str(mode_qst));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment