Skip to content

Commit dcb6955

Browse files
committed
use boolean and symbols
1 parent 791aefd commit dcb6955

File tree

1 file changed

+6
-6
lines changed
  • ports/broadcom/common-hal/neopixel_write

1 file changed

+6
-6
lines changed

ports/broadcom/common-hal/neopixel_write/__init__.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,22 +141,22 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t *digitalinout,
141141
}
142142
if (channel == 1) {
143143
icnt = 0;
144-
while ((pwm->STA_b.FULL1 == 1) & (icnt++ < 150)) {
144+
while ((pwm->STA_b.FULL1 == 1) && (icnt++ < 150)) {
145145
RUN_BACKGROUND_TASKS;
146146
COMPLETE_MEMORY_READS;
147147
}
148148
// Dummy value for the first channel.
149149
pwm->FIF1 = 0x000000;
150150
}
151151
icnt = 0;
152-
while ((pwm->STA_b.FULL1 == 1) & (icnt++ < 150)) {
152+
while ((pwm->STA_b.FULL1 == 1) && (icnt++ < 150)) {
153153
RUN_BACKGROUND_TASKS;
154154
COMPLETE_MEMORY_READS;
155155
}
156156
pwm->FIF1 = expanded;
157157
if (channel == 0) {
158158
icnt = 0;
159-
while ((pwm->STA_b.FULL1 == 1) & (icnt++ < 150)) {
159+
while ((pwm->STA_b.FULL1 == 1) && (icnt++ < 150)) {
160160
RUN_BACKGROUND_TASKS;
161161
COMPLETE_MEMORY_READS;
162162
}
@@ -166,19 +166,19 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t *digitalinout,
166166
}
167167

168168
icnt = 0;
169-
while ((pwm->STA_b.EMPT1 == 0) & (icnt++ < 2500)) {
169+
while ((pwm->STA_b.EMPT1 == 0) && (icnt++ < 2500)) {
170170
RUN_BACKGROUND_TASKS;
171171
COMPLETE_MEMORY_READS;
172172
}
173173
// Wait for transmission to start.
174174
icnt = 0;
175-
while (((pwm->STA_b.STA1 == 0) & (pwm->STA_b.STA2 == 0)) & (icnt++ < 150)) {
175+
while (((pwm->STA_b.STA1 == 0) && (pwm->STA_b.STA2 == 0)) && (icnt++ < 150)) {
176176
RUN_BACKGROUND_TASKS;
177177
COMPLETE_MEMORY_READS;
178178
}
179179
// Wait for transmission to complete.
180180
icnt = 0;
181-
while (((pwm->STA_b.STA1 == 1) | (pwm->STA_b.STA2 == 1)) & (icnt++ < 150)) {
181+
while (((pwm->STA_b.STA1 == 1) | (pwm->STA_b.STA2 == 1)) && (icnt++ < 150)) {
182182
RUN_BACKGROUND_TASKS;
183183
COMPLETE_MEMORY_READS;
184184
}

0 commit comments

Comments
 (0)