diff options
author | Ryan <fauxpark@gmail.com> | 2024-02-18 17:08:27 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-18 17:08:27 +1100 |
commit | 2d1aed78a67b3d2b002cc739ef087963b05b76b8 (patch) | |
tree | ea681d02e547332cffa6b7aec6c16ef37ad70ee3 /drivers/bluetooth | |
parent | 6810aaf0130113e267e20fb506d874cc858f5f67 (diff) |
Update GPIO macro usages in core (#23093)
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r-- | drivers/bluetooth/bluefruit_le.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/bluetooth/bluefruit_le.cpp b/drivers/bluetooth/bluefruit_le.cpp index 39c14ddd13..218eca2195 100644 --- a/drivers/bluetooth/bluefruit_le.cpp +++ b/drivers/bluetooth/bluefruit_le.cpp @@ -188,7 +188,7 @@ static bool sdep_recv_pkt(struct sdep_msg *msg, uint16_t timeout) { bool ready = false; do { - ready = readPin(BLUEFRUIT_LE_IRQ_PIN); + ready = gpio_read_pin(BLUEFRUIT_LE_IRQ_PIN); if (ready) { break; } @@ -231,7 +231,7 @@ static void resp_buf_read_one(bool greedy) { return; } - if (readPin(BLUEFRUIT_LE_IRQ_PIN)) { + if (gpio_read_pin(BLUEFRUIT_LE_IRQ_PIN)) { struct sdep_msg msg; again: @@ -242,7 +242,7 @@ static void resp_buf_read_one(bool greedy) { dprintf("recv latency %dms\n", TIMER_DIFF_16(timer_read(), last_send)); } - if (greedy && resp_buf.peek(last_send) && readPin(BLUEFRUIT_LE_IRQ_PIN)) { + if (greedy && resp_buf.peek(last_send) && gpio_read_pin(BLUEFRUIT_LE_IRQ_PIN)) { goto again; } } @@ -293,16 +293,16 @@ void bluefruit_le_init(void) { state.configured = false; state.is_connected = false; - setPinInput(BLUEFRUIT_LE_IRQ_PIN); + gpio_set_pin_input(BLUEFRUIT_LE_IRQ_PIN); spi_init(); // Perform a hardware reset - setPinOutput(BLUEFRUIT_LE_RST_PIN); - writePinHigh(BLUEFRUIT_LE_RST_PIN); - writePinLow(BLUEFRUIT_LE_RST_PIN); + gpio_set_pin_output(BLUEFRUIT_LE_RST_PIN); + gpio_write_pin_high(BLUEFRUIT_LE_RST_PIN); + gpio_write_pin_low(BLUEFRUIT_LE_RST_PIN); wait_ms(10); - writePinHigh(BLUEFRUIT_LE_RST_PIN); + gpio_write_pin_high(BLUEFRUIT_LE_RST_PIN); wait_ms(1000); // Give it a second to initialize @@ -508,7 +508,7 @@ void bluefruit_le_task(void) { resp_buf_read_one(true); send_buf_send_one(SdepShortTimeout); - if (resp_buf.empty() && (state.event_flags & UsingEvents) && readPin(BLUEFRUIT_LE_IRQ_PIN)) { + if (resp_buf.empty() && (state.event_flags & UsingEvents) && gpio_read_pin(BLUEFRUIT_LE_IRQ_PIN)) { // Must be an event update if (at_command_P(PSTR("AT+EVENTSTATUS"), resbuf, sizeof(resbuf))) { uint32_t mask = strtoul(resbuf, NULL, 16); |