File tree Expand file tree Collapse file tree
circuitplayground_express_crickit
raspberrypi/common-hal/digitalio Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ CIRCUITPY_ROTARYIO = 0
2222CIRCUITPY_RTC = 0
2323
2424SUPEROPT_GC = 0
25- CFLAGS_INLINE_LIMIT = 50
25+ CFLAGS_INLINE_LIMIT = 40
2626
2727
2828# Include these Python libraries in firmware.
Original file line number Diff line number Diff line change @@ -11,14 +11,6 @@ LONGINT_IMPL = NONE
1111CIRCUITPY_FULL_BUILD = 0
1212
1313SUPEROPT_GC = 0
14+ SUPEROPT_VM = 0
1415
1516CFLAGS_BOARD = --param max-inline-insns-auto=15
16- ifeq ($(TRANSLATION ) , zh_Latn_pinyin)
17- RELEASE_NEEDS_CLEAN_BUILD = 1
18- CFLAGS_INLINE_LIMIT = 35
19- endif
20- ifeq ($(TRANSLATION ) , de_DE)
21- RELEASE_NEEDS_CLEAN_BUILD = 1
22- CFLAGS_INLINE_LIMIT = 35
23- SUPEROPT_VM = 0
24- endif
Original file line number Diff line number Diff line change @@ -76,8 +76,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_switch_to_output(
7676 digitalio_drive_mode_t drive_mode ) {
7777 const uint8_t pin = self -> pin -> number ;
7878 gpio_set_dir (pin , GPIO_OUT );
79- // Turn on "strong" pin driving (more current available). See DRVSTR doc in datasheet.
80- // hri_port_set_PINCFG_DRVSTR_bit(PORT, (enum gpio_port)GPIO_PORT(pin), GPIO_PIN(pin));
79+ // TODO: Turn on "strong" pin driving (more current available).
8180
8281 self -> output = true;
8382 common_hal_digitalio_digitalinout_set_drive_mode (self , drive_mode );
@@ -140,18 +139,16 @@ void common_hal_digitalio_digitalinout_set_pull(
140139
141140digitalio_pull_t common_hal_digitalio_digitalinout_get_pull (
142141 digitalio_digitalinout_obj_t * self ) {
143- // uint32_t pin = self->pin->number;
144- // if (self->output) {
145- // mp_raise_AttributeError(translate("Cannot get pull while in output mode"));
146- // return PULL_NONE;
147- // } else {
148- // if (hri_port_get_PINCFG_PULLEN_bit(PORT, GPIO_PORT(pin), GPIO_PIN(pin)) == 0) {
149- // return PULL_NONE;
150- // } if (hri_port_get_OUT_reg(PORT, GPIO_PORT(pin), 1U << GPIO_PIN(pin)) > 0) {
151- // return PULL_UP;
152- // } else {
153- // return PULL_DOWN;
154- // }
155- // }
142+ uint32_t pin = self -> pin -> number ;
143+ if (self -> output ) {
144+ mp_raise_AttributeError (translate ("Cannot get pull while in output mode" ));
145+ return PULL_NONE ;
146+ } else {
147+ if (gpio_is_pulled_up (pin )) {
148+ return PULL_UP ;
149+ } else if (gpio_is_pulled_down (pin )) {
150+ return PULL_DOWN ;
151+ }
152+ }
156153 return PULL_NONE ;
157154}
You can’t perform that action at this time.
0 commit comments