awacs: minor improvements (proper initialization).

This commit is contained in:
Maxim Poliakovski 2023-04-23 21:32:41 +02:00
parent 22798fe14e
commit 26374366c7

View File

@ -73,7 +73,7 @@ public:
void write_ctrl(uint32_t addr, uint16_t value); void write_ctrl(uint32_t addr, uint16_t value);
private: private:
uint16_t ctrl_regs[5]; // 12-bit wide control registers uint16_t ctrl_regs[5] = {}; // 12-bit wide control registers
}; };
/** Offsets to MacIO sound codec registers. */ /** Offsets to MacIO sound codec registers. */
@ -102,7 +102,7 @@ public:
bool send_subaddress(uint8_t sub_addr) { bool send_subaddress(uint8_t sub_addr) {
if ((sub_addr & 0xF) > 6) if ((sub_addr & 0xF) > 6)
return false; /* invalid subaddress -> no acknowledge */ return false; // invalid subaddress -> no acknowledge
this->sub_addr = sub_addr & 0xF; this->sub_addr = sub_addr & 0xF;
this->auto_inc = !!(sub_addr & 0x10); this->auto_inc = !!(sub_addr & 0x10);
@ -123,7 +123,7 @@ public:
} }
return true; return true;
} else { } else {
return false; /* invalid sub_addr -> no acknowledge */ return false; // invalid sub_addr -> no acknowledge
} }
}; };
@ -134,7 +134,7 @@ public:
}; };
private: private:
uint8_t regs[7]; /* control registers, see TDA7433 datasheet */ uint8_t regs[7] = {}; // control registers, see TDA7433 datasheet
uint8_t sub_addr; uint8_t sub_addr;
int pos; int pos;
int auto_inc; int auto_inc;
@ -168,8 +168,8 @@ public:
} }
private: private:
uint32_t snd_ctrl_reg = { 0 }; uint32_t snd_ctrl_reg = 0;
uint16_t control_regs[8] = { 0 }; // control registers, each 12-bits wide uint16_t control_regs[8] = {}; // control registers, each 12-bits wide
uint8_t is_busy = 0; uint8_t is_busy = 0;
std::unique_ptr<AudioProcessor> audio_proc; std::unique_ptr<AudioProcessor> audio_proc;