ams: support building unit test programs on windows/linux/macos

This commit is contained in:
Michael Scire 2022-03-06 12:08:20 -08:00 committed by SciresM
parent 9a38be201a
commit 64a97576d0
756 changed files with 33359 additions and 9372 deletions

View file

@ -59,7 +59,7 @@ namespace ams::gpio::driver {
virtual Result SetDebounceTime(Pad *pad, s32 ms) = 0;
virtual Result GetUnknown22(u32 *out) = 0;
virtual void Unknown23();
virtual void Unknown23() = 0;
virtual Result SetValueForSleepState(Pad *pad, GpioValue value) = 0;
virtual Result IsWakeEventActive(bool *out, Pad *pad) const = 0;

View file

@ -32,7 +32,7 @@
#else
#error "Unknown board for ams::gpio::driver::"
// TODO: #error "Unknown board for ams::gpio::driver::"
#endif

View file

@ -0,0 +1,41 @@
/*
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <vapours.hpp>
#include <stratosphere/gpio/gpio_types.hpp>
namespace ams::gpio {
enum GpioPadName : u32 {
GpioPadName_EnableSdCardPower = 2,
};
constexpr inline const DeviceCode DeviceCode_EnableSdCardPower = 0x3C000001;
constexpr inline GpioPadName ConvertToGpioPadName(DeviceCode dc) {
switch (dc.GetInternalValue()) {
case DeviceCode_EnableSdCardPower.GetInternalValue(): return GpioPadName_EnableSdCardPower;
AMS_UNREACHABLE_DEFAULT_CASE();
}
}
constexpr inline DeviceCode ConvertToDeviceCode(GpioPadName gpn) {
switch (gpn) {
case GpioPadName_EnableSdCardPower: return DeviceCode_EnableSdCardPower;
AMS_UNREACHABLE_DEFAULT_CASE();
}
}
}

View file

@ -20,5 +20,5 @@
#if defined(ATMOSPHERE_BOARD_NINTENDO_NX)
#include <stratosphere/gpio/gpio_pad_name.board.nintendo_nx.hpp>
#else
/* Error? */
#include <stratosphere/gpio/gpio_pad_name.generic.hpp>
#endif