diff --git a/Devices/lilygo-tdisplay/lilygo,tdisplay.dts b/Devices/lilygo-tdisplay/lilygo,tdisplay.dts index ecf6ca86..87da67c7 100644 --- a/Devices/lilygo-tdisplay/lilygo,tdisplay.dts +++ b/Devices/lilygo-tdisplay/lilygo,tdisplay.dts @@ -17,7 +17,7 @@ spi0 { compatible = "espressif,esp32-spi"; host = ; - pin-mosi = <&gpio0 19 GPIO_FLAG_NONE>; - pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>; + pin-mosi = <19>; + pin-sclk = <18>; }; }; diff --git a/Platforms/PlatformEsp32/Source/drivers/esp32_i2c.cpp b/Platforms/PlatformEsp32/Source/drivers/esp32_i2c.cpp index d4cbe943..c1ce347f 100644 --- a/Platforms/PlatformEsp32/Source/drivers/esp32_i2c.cpp +++ b/Platforms/PlatformEsp32/Source/drivers/esp32_i2c.cpp @@ -1,6 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 #include +#include + #include #include #include @@ -205,7 +207,8 @@ static error_t start(Device* device) { 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); return ERROR_NONE; diff --git a/TactilityKernel/Source/drivers/gpio_controller.cpp b/TactilityKernel/Source/drivers/gpio_controller.cpp index 4b3f208e..336183a1 100644 --- a/TactilityKernel/Source/drivers/gpio_controller.cpp +++ b/TactilityKernel/Source/drivers/gpio_controller.cpp @@ -9,7 +9,7 @@ #include #include -#define GPIO_INTERNAL_API(driver) ((struct GpioControllerApi*)driver->api) +#define GPIO_INTERNAL_API(driver) ((struct GpioControllerApi*)(driver)->api) extern "C" {