Skip to content

Commit 9791a48

Browse files
Родион Квашнинigrr
Родион Квашнин
authored andcommitted
Fixed incorrect usage of memset() in PWM code which leads to incomplete initialization of struct. Thanks to GCC warning -Wsizeof-pointer-memaccess.
1 parent a444898 commit 9791a48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/esp8266/core_esp8266_wiring_pwm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ extern void __analogWrite(uint8_t pin, int value)
187187
}
188188
if((pwm_mask & (1 << pin)) == 0) {
189189
if(pwm_mask == 0) {
190-
memset(&_pwm_isr_data, 0, sizeof(struct pwm_isr_data*));
190+
memset(&_pwm_isr_data, 0, sizeof(_pwm_isr_data));
191191
start_timer = true;
192192
}
193193
pinMode(pin, OUTPUT);

0 commit comments

Comments
 (0)