input_common: joycon: Remove magic numbers from calibration protocol

This commit is contained in:
Narr the Reg 2023-01-27 13:12:54 -06:00
parent 55da8e8ed8
commit f20ec6f69b
6 changed files with 203 additions and 108 deletions

View file

@ -72,7 +72,7 @@ DriverResult GenericProtocol::GetBattery(u32& battery_level) {
DriverResult GenericProtocol::GetColor(Color& color) {
ScopedSetBlocking sb(this);
std::vector<u8> buffer;
const auto result = ReadSPI(CalAddr::COLOR_DATA, 12, buffer);
const auto result = ReadSPI(SpiAddress::COLOR_DATA, 12, buffer);
color = {};
if (result == DriverResult::Success) {
@ -88,7 +88,7 @@ DriverResult GenericProtocol::GetColor(Color& color) {
DriverResult GenericProtocol::GetSerialNumber(SerialNumber& serial_number) {
ScopedSetBlocking sb(this);
std::vector<u8> buffer;
const auto result = ReadSPI(CalAddr::SERIAL_NUMBER, 16, buffer);
const auto result = ReadSPI(SpiAddress::SERIAL_NUMBER, 16, buffer);
serial_number = {};
if (result == DriverResult::Success) {