Update GPIO macro usages in core (#23093)
This commit is contained in:
parent
6810aaf013
commit
2d1aed78a6
61 changed files with 334 additions and 334 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue