mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-08-18 07:55:06 +00:00
PR feedback
This commit is contained in:
parent
1060d93dde
commit
c23d15151a
@ -1,8 +1,10 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#include "papers3_power.h"
|
||||
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/driver.h>
|
||||
#include <tactility/drivers/gpio.h>
|
||||
#include <tactility/drivers/gpio_controller.h>
|
||||
#include <tactility/drivers/power_supply.h>
|
||||
#include <tactility/drivers/pwm.h>
|
||||
@ -13,7 +15,7 @@
|
||||
|
||||
#include <new>
|
||||
|
||||
#define TAG "Papers3Power"
|
||||
constexpr auto* TAG = "Papers3Power";
|
||||
#define GET_CONFIG(device) (static_cast<const Papers3PowerConfig*>((device)->config))
|
||||
|
||||
// Power-off signal timing, ported from the old deprecated-HAL PaperS3Power::powerOff().
|
||||
@ -192,7 +194,7 @@ static void destroy_power_supply_child(Device* child) {
|
||||
// region Driver lifecycle
|
||||
|
||||
static error_t acquire_input(const GpioPinSpec& pin, GpioDescriptor** out_descriptor) {
|
||||
*out_descriptor = gpio_descriptor_acquire(pin.gpio_controller, pin.pin, GPIO_FLAG_DIRECTION_INPUT, GPIO_OWNER_GPIO);
|
||||
*out_descriptor = gpio_descriptor_acquire(pin.gpio_controller, pin.pin, pin.flags | GPIO_FLAG_DIRECTION_INPUT, GPIO_OWNER_GPIO);
|
||||
return (*out_descriptor != nullptr) ? ERROR_NONE : ERROR_RESOURCE;
|
||||
}
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
#include <tactility/filesystem/file_system.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
#define TAG "esp32_sdmmc"
|
||||
constexpr auto* TAG = "esp32_sdmmc";
|
||||
|
||||
#define GET_CONFIG(device) ((const struct Esp32SdmmcConfig*)device->config)
|
||||
#define GET_DATA(device) ((struct Esp32SdmmcInternal*)device_get_driver_data(device))
|
||||
@ -85,7 +85,7 @@ static error_t start(Device* device) {
|
||||
// Acquire pins from the specified GPIO pin specs. Optional pins are allowed.
|
||||
bool pins_ok =
|
||||
acquire_pin_or_set_null(sdmmc_config->pin_clk, GPIO_FLAG_DIRECTION_OUTPUT, &data->pin_clk_descriptor) &&
|
||||
acquire_pin_or_set_null(sdmmc_config->pin_cmd, GPIO_FLAG_DIRECTION_OUTPUT, &data->pin_cmd_descriptor) &&
|
||||
acquire_pin_or_set_null(sdmmc_config->pin_cmd, GPIO_FLAG_DIRECTION_INPUT_OUTPUT, &data->pin_cmd_descriptor) &&
|
||||
acquire_pin_or_set_null(sdmmc_config->pin_d0, GPIO_FLAG_DIRECTION_INPUT_OUTPUT, &data->pin_d0_descriptor) &&
|
||||
acquire_pin_or_set_null(sdmmc_config->pin_d1, GPIO_FLAG_DIRECTION_INPUT_OUTPUT, &data->pin_d1_descriptor) &&
|
||||
acquire_pin_or_set_null(sdmmc_config->pin_d2, GPIO_FLAG_DIRECTION_INPUT_OUTPUT, &data->pin_d2_descriptor) &&
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user