Skip to content

Commit 5b31075

Browse files
committed
Get rid of compiler warnings in microbitdisplay.cpp.
1 parent 72c86d7 commit 5b31075

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

source/microbit/microbitdisplay.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ static mp_obj_t async_iterator = NULL;
103103
// Record if an error occurs in async animation. Unfortunately there is no way to report this.
104104
static bool async_error = false;
105105
static volatile bool wakeup_event = false;
106-
static uint16_t async_nonce = 0;
107106
static mp_uint_t async_delay = 1000;
108107
static mp_uint_t async_tick = 0;
109108

@@ -156,7 +155,7 @@ inline void microbit_display_obj_t::setPinsForRow(uint8_t brightness) {
156155

157156
// Wwrite the new bit pattern.
158157
// Set port 0 4-7 and retain lower 4 bits.
159-
nrf_gpio_port_write(NRF_GPIO_PORT_SELECT_PORT0, ~column_strobe<<4 & 0xF0 | nrf_gpio_port_read(NRF_GPIO_PORT_SELECT_PORT0) & 0x0F);
158+
nrf_gpio_port_write(NRF_GPIO_PORT_SELECT_PORT0, (~column_strobe<<4 & 0xF0) | (nrf_gpio_port_read(NRF_GPIO_PORT_SELECT_PORT0) & 0x0F));
160159

161160
// Set port 1 8-12 for the current row.
162161
nrf_gpio_port_write(NRF_GPIO_PORT_SELECT_PORT1, strobe_mask | (~column_strobe>>4 & 0x1F));
@@ -167,7 +166,7 @@ void microbit_display_obj_t::advanceRow() {
167166

168167
// Clear the old bit pattern for this row.
169168
// Clear port 0 4-7 and retain lower 4 bits.
170-
nrf_gpio_port_write(NRF_GPIO_PORT_SELECT_PORT0, 0xF0 | nrf_gpio_port_read(NRF_GPIO_PORT_SELECT_PORT0) & 0x0F);
169+
nrf_gpio_port_write(NRF_GPIO_PORT_SELECT_PORT0, 0xF0 | (nrf_gpio_port_read(NRF_GPIO_PORT_SELECT_PORT0) & 0x0F));
171170
// Clear port 1 8-12 for the current row.
172171
nrf_gpio_port_write(NRF_GPIO_PORT_SELECT_PORT1, strobe_mask | 0x1F);
173172

0 commit comments

Comments
 (0)