Browse Source

pwm: zero-init things ourselves

looks like bootloader implementation avoids static and bss zero-init
does not solve the crashing, though
pull/2552/head
Maxim Prokhorov 1 year ago
parent
commit
c5ad7b4a75
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      code/espurna/esp8266_pwm.c

+ 6
- 6
code/espurna/esp8266_pwm.c View File

@ -70,18 +70,18 @@ struct pwm_phase {
* pwm phase
*/
typedef struct pwm_phase (pwm_phase_array)[PWM_MAX_CHANNELS + 2];
static pwm_phase_array pwm_phases[3];
static pwm_phase_array pwm_phases[3] = {0};
static struct {
struct pwm_phase* next_set;
struct pwm_phase* current_set;
uint8_t current_phase;
} pwm_state;
static uint32_t pwm_period;
static uint32_t pwm_period_ticks;
static uint32_t pwm_duty[PWM_MAX_CHANNELS];
static uint16_t gpio_mask[PWM_MAX_CHANNELS];
static uint8_t pwm_channels;
static uint32_t pwm_period = 0;
static uint32_t pwm_period_ticks = 0;
static uint32_t pwm_duty[PWM_MAX_CHANNELS] = {0};
static uint16_t gpio_mask[PWM_MAX_CHANNELS] = {0};
static uint8_t pwm_channels = {0};
struct gpio_regs {
uint32_t out; /* 0x60000300 */


Loading…
Cancel
Save