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

@@ -20,6 +20,7 @@
namespace ams::powctl::driver::impl {
#if defined(ATMOSPHERE_BOARD_NINTENDO_NX)
class ChargeArbiter {
private:
const ChargeParametersRule *m_rules;
@@ -118,6 +119,7 @@ namespace ams::powctl::driver::impl {
void UpdateSelectedRule() {
/* Try to find an entry that fits our current requirements. */
const ChargeParametersRule *best_rule = nullptr;
for (size_t i = 0; i < m_num_rules; ++i) {
/* Get the current rule. */
const ChargeParametersRule &cur_rule = m_rules[i];
@@ -184,5 +186,6 @@ namespace ams::powctl::driver::impl {
m_selected_rule = best_rule;
}
};
#endif
}

View File

@@ -0,0 +1,34 @@
/*
* 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/powctl/powctl_types.hpp>
namespace ams::powctl::driver::impl {
struct ChargeParametersRule {
/* ... */
};
struct UnknownParameterX {
/* ... */
};
struct ChargeParameters {
/* ... */
};
}

View File

@@ -18,9 +18,7 @@
#include <stratosphere/powctl/powctl_types.hpp>
#if defined(ATMOSPHERE_BOARD_NINTENDO_NX)
#include <stratosphere/powctl/driver/impl/powctl_charger_parameters.board.nintendo_nx.hpp>
#else
#error "unknown board for powctl::driver::impl::ChargerParameters"
#include <stratosphere/powctl/driver/impl/powctl_charger_parameters.generic.hpp>
#endif