mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-24 06:49:24 -05:00
Extract PPB reset value to a constant.
Group with related constants.
This commit is contained in:
parent
52ba9af1c7
commit
4870f0015b
@ -49,6 +49,7 @@ struct range_t {
|
||||
|
||||
using ppb_range_t = range_t<ppb_t>;
|
||||
constexpr ppb_range_t ppb_range { -99000, 99000 };
|
||||
constexpr ppb_t ppb_reset_value { 0 };
|
||||
|
||||
/* struct must pack the same way on M4 and M0 cores. */
|
||||
struct data_t {
|
||||
@ -60,7 +61,7 @@ static_assert(sizeof(data_t) <= 0x100, "Persistent memory structure too large fo
|
||||
static data_t* const data = reinterpret_cast<data_t*>(LPC_BACKUP_REG_BASE);
|
||||
|
||||
ppb_t correction_ppb() {
|
||||
ppb_range.reset_if_outside(data->correction_ppb, 0);
|
||||
ppb_range.reset_if_outside(data->correction_ppb, ppb_reset_value);
|
||||
return data->correction_ppb;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user