From 4e0587bb8e9658c44fac0c26c29e9d59eea0fbed Mon Sep 17 00:00:00 2001 From: Leif Jakob Date: Tue, 25 Apr 2023 09:41:37 +0200 Subject: [PATCH] use weak references for HAL functions that control low-speed pins - allows override with own symbols --- src/hal/hal_esp32.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hal/hal_esp32.c b/src/hal/hal_esp32.c index c967fbd..6ec41f0 100755 --- a/src/hal/hal_esp32.c +++ b/src/hal/hal_esp32.c @@ -152,6 +152,7 @@ void init_io(void) ESP_LOGI(TAG, "IO initialized"); } +__attribute__((weak)) // duplicate this symbol if your pin is controlled by e.g. I2C void hal_pin_rxtx(u1_t val) { if (pin_rx_tx == LMIC_UNUSED_PIN) @@ -160,6 +161,7 @@ void hal_pin_rxtx(u1_t val) gpio_set_level(pin_rx_tx, val); } +__attribute__((weak)) // duplicate this symbol if your pin is controlled by e.g. I2C void hal_pin_rst(u1_t val) { if (pin_rst == LMIC_UNUSED_PIN) @@ -252,6 +254,7 @@ void hal_spi_read(u1_t cmd, u1_t *buf, size_t len) ESP_ERROR_CHECK(err); } + void IRAM_ATTR assert_nss(spi_transaction_t* trans) { gpio_set_level(pin_nss, 0);