File tree Expand file tree Collapse file tree 3 files changed +14
-25
lines changed
circuitplayground_express_crickit
raspberrypi/common-hal/digitalio Expand file tree Collapse file tree 3 files changed +14
-25
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ CIRCUITPY_ROTARYIO = 0
22
22
CIRCUITPY_RTC = 0
23
23
24
24
SUPEROPT_GC = 0
25
- CFLAGS_INLINE_LIMIT = 50
25
+ CFLAGS_INLINE_LIMIT = 40
26
26
27
27
28
28
# Include these Python libraries in firmware.
Original file line number Diff line number Diff line change @@ -11,14 +11,6 @@ LONGINT_IMPL = NONE
11
11
CIRCUITPY_FULL_BUILD = 0
12
12
13
13
SUPEROPT_GC = 0
14
+ SUPEROPT_VM = 0
14
15
15
16
CFLAGS_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(
76
76
digitalio_drive_mode_t drive_mode ) {
77
77
const uint8_t pin = self -> pin -> number ;
78
78
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).
81
80
82
81
self -> output = true;
83
82
common_hal_digitalio_digitalinout_set_drive_mode (self , drive_mode );
@@ -140,18 +139,16 @@ void common_hal_digitalio_digitalinout_set_pull(
140
139
141
140
digitalio_pull_t common_hal_digitalio_digitalinout_get_pull (
142
141
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
+ }
156
153
return PULL_NONE ;
157
154
}
You can’t perform that action at this time.
0 commit comments