Skip to content

Commit de9fd4a

Browse files
committed
Fix null dereference, invert auto_brightness to reenable screen
1 parent c137a16 commit de9fd4a

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

ports/stm/boards/meowbit_v121/board.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void board_init(void) {
106106
&pin_PB03,
107107
NO_BRIGHTNESS_COMMAND,
108108
1.0f, // brightness (ignored)
109-
true, // auto_brightness
109+
false, // auto_brightness
110110
false, // single_byte_bounds
111111
false, // data_as_commands
112112
true, // auto_refresh

ports/stm/boards/meowbit_v121/mpconfigboard.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ OPTIMIZATION_FLAGS = -Os
1818

1919
LD_COMMON = boards/common_default.ld
2020
LD_FILE = boards/STM32F401xe_boot.ld
21-
# LD_FILE = boards/STM32F401xe_fs.ld # use for internal flash
21+
22+
# For debugging - also comment BOOTLOADER_OFFSET and BOARD_VTOR_DEFER
23+
# LD_FILE = boards/STM32F401xe_fs.ld

ports/stm/common-hal/pulseio/PWMOut.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,14 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
239239
HAL_TIM_PWM_Stop(&self->handle, self->channel);
240240
}
241241
reset_pin_number(self->tim->pin->port,self->tim->pin->number);
242-
self->tim = NULL;
243242

244243
//if reserved timer has no active channels, we can disable it
245244
if (!reserved_tim[self->tim->tim_index - 1]) {
246245
tim_frequencies[self->tim->tim_index - 1] = 0x00;
247246
stm_peripherals_timer_free(self->handle.Instance);
248247
}
248+
249+
self->tim = NULL;
249250
}
250251

251252
void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty) {

0 commit comments

Comments
 (0)