summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucian Copeland <hierophect@gmail.com>2020-08-24 17:59:13 -0400
committerLucian Copeland <hierophect@gmail.com>2020-08-25 10:37:55 -0400
commitde9fd4a0fb26c1a62b97d6175c75568b68e50abd (patch)
tree1dcfe3166891fd7f3a091bf3243334adacd61e98
parentc137a1612133e06d2b7bec06b325695c9a60c4b9 (diff)
Fix null dereference, invert auto_brightness to reenable screen
-rw-r--r--ports/stm/boards/meowbit_v121/board.c2
-rw-r--r--ports/stm/boards/meowbit_v121/mpconfigboard.mk4
-rw-r--r--ports/stm/common-hal/pulseio/PWMOut.c3
3 files changed, 6 insertions, 3 deletions
diff --git a/ports/stm/boards/meowbit_v121/board.c b/ports/stm/boards/meowbit_v121/board.c
index 812a8c208..b74f13516 100644
--- a/ports/stm/boards/meowbit_v121/board.c
+++ b/ports/stm/boards/meowbit_v121/board.c
@@ -106,7 +106,7 @@ void board_init(void) {
&pin_PB03,
NO_BRIGHTNESS_COMMAND,
1.0f, // brightness (ignored)
- true, // auto_brightness
+ false, // auto_brightness
false, // single_byte_bounds
false, // data_as_commands
true, // auto_refresh
diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.mk b/ports/stm/boards/meowbit_v121/mpconfigboard.mk
index 852836ef8..9eaa1bd8f 100644
--- a/ports/stm/boards/meowbit_v121/mpconfigboard.mk
+++ b/ports/stm/boards/meowbit_v121/mpconfigboard.mk
@@ -18,4 +18,6 @@ OPTIMIZATION_FLAGS = -Os
LD_COMMON = boards/common_default.ld
LD_FILE = boards/STM32F401xe_boot.ld
-# LD_FILE = boards/STM32F401xe_fs.ld # use for internal flash
+
+# For debugging - also comment BOOTLOADER_OFFSET and BOARD_VTOR_DEFER
+# LD_FILE = boards/STM32F401xe_fs.ld
diff --git a/ports/stm/common-hal/pulseio/PWMOut.c b/ports/stm/common-hal/pulseio/PWMOut.c
index ddbadaf4c..4bcb07212 100644
--- a/ports/stm/common-hal/pulseio/PWMOut.c
+++ b/ports/stm/common-hal/pulseio/PWMOut.c
@@ -239,13 +239,14 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
HAL_TIM_PWM_Stop(&self->handle, self->channel);
}
reset_pin_number(self->tim->pin->port,self->tim->pin->number);
- self->tim = NULL;
//if reserved timer has no active channels, we can disable it
if (!reserved_tim[self->tim->tim_index - 1]) {
tim_frequencies[self->tim->tim_index - 1] = 0x00;
stm_peripherals_timer_free(self->handle.Instance);
}
+
+ self->tim = NULL;
}
void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty) {