mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-19 23:15:05 +00:00
Fixes
This commit is contained in:
parent
fc941ff495
commit
d178d674f4
@ -17,7 +17,7 @@
|
|||||||
spi0 {
|
spi0 {
|
||||||
compatible = "espressif,esp32-spi";
|
compatible = "espressif,esp32-spi";
|
||||||
host = <SPI2_HOST>;
|
host = <SPI2_HOST>;
|
||||||
pin-mosi = <&gpio0 19 GPIO_FLAG_NONE>;
|
pin-mosi = <19>;
|
||||||
pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>;
|
pin-sclk = <18>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
#include <driver/i2c.h>
|
#include <driver/i2c.h>
|
||||||
|
|
||||||
|
#include <new>
|
||||||
|
|
||||||
#include <tactility/error_esp32.h>
|
#include <tactility/error_esp32.h>
|
||||||
#include <tactility/driver.h>
|
#include <tactility/driver.h>
|
||||||
#include <tactility/drivers/gpio_controller.h>
|
#include <tactility/drivers/gpio_controller.h>
|
||||||
@ -205,7 +207,8 @@ static error_t start(Device* device) {
|
|||||||
return ERROR_RESOURCE;
|
return ERROR_RESOURCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto* data = new Esp32SpiInternal(sda_descriptor, scl_descriptor);
|
auto* data = new(std::nothrow) Esp32SpiInternal(sda_descriptor, scl_descriptor);
|
||||||
|
if (data == nullptr) return ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
device_set_driver_data(device, data);
|
device_set_driver_data(device, data);
|
||||||
return ERROR_NONE;
|
return ERROR_NONE;
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <new>
|
#include <new>
|
||||||
|
|
||||||
#define GPIO_INTERNAL_API(driver) ((struct GpioControllerApi*)driver->api)
|
#define GPIO_INTERNAL_API(driver) ((struct GpioControllerApi*)(driver)->api)
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user