Use new fancy way to set values at build time
This commit is contained in:
@@ -9,7 +9,7 @@ namespace SPU {
|
||||
}
|
||||
|
||||
static void clear_main_volume() {
|
||||
static constexpr auto StartVol = SweepVolume().clear_bit(SweepVolume::SweepEnable).set_value(static_cast<int16_t>(I16_MAX >> 2), SweepVolume::Volume);
|
||||
static constexpr auto StartVol = SweepVolume() | !SweepVolume::SweepEnable | (SweepVolume::Volume << static_cast<int16_t>(I16_MAX >> 2));
|
||||
|
||||
MainVolume::left.write(StartVol);
|
||||
MainVolume::right.write(StartVol);
|
||||
@@ -19,9 +19,17 @@ namespace SPU {
|
||||
Control.write(ControlRegister());
|
||||
}
|
||||
|
||||
static void setup_control_register() {
|
||||
static constexpr auto SetupValue = ControlRegister() | ControlRegister::Enable | ControlRegister::Unmute | ControlRegister::CDAudioEnable;
|
||||
|
||||
Control.write(SetupValue);
|
||||
}
|
||||
|
||||
void setup() {
|
||||
clear_key();
|
||||
clear_main_volume();
|
||||
clear_control_register();
|
||||
|
||||
setup_control_register();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user