8000 Renamed the interrupt management functions · timkoers/arduino-esp32@def8f9c · GitHub
[go: up one dir, main page]

Skip to content

Commit def8f9c

Browse files
committed
Renamed the interrupt management functions
1 parent 7bea5a4 commit def8f9c

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

cores/esp32/HardwareSerial.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ void HardwareSerial::updateBaudRate(unsigned long baud)
8484
}
8585

8686
// Make sure that the function that the function pointer is pointing to is inside IRAM
87-
void HardwareSerial::setRXInterrupt(void (*arg)(uint8_t, void*), void* user_arg){
87+
void HardwareSerial::setRxInterrupt(void (*arg)(uint8_t, void*), void* user_arg){
8888

8989
// Make sure that the previous interrupt_info is not used anymore
9090
uartDisableInterrupt(_uart);
9191

9292
if(interrupt_info)
9393
delete(interrupt_info);
9494

95-
uartEnableInterrupt(_uart, &interrupt_info, arg, user_arg);
95+
uartEnableRxInterrupt(_uart, &interrupt_info, arg, user_arg);
9696
}
9797

9898
void HardwareSerial::end()

cores/esp32/HardwareSerial.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class HardwareSerial: public Stream
5959
void begin(unsigned long baud, uint32_t config=SERIAL_8N1, int8_t rxPin=-1, int8_t txPin=-1, bool invert=false, unsigned long timeout_ms = 20000UL);
6060
void end();
6161
void updateBaudRate(unsigned long baud);
62-
void setRXInterrupt(void (*arg)(uint8_t, void*), void* user_arg);
62+
void setRxInterrupt(void (*arg)(uint8_t, void*), void* user_arg);
6363
int available(void);
6464
int availableForWrite(void);
6565
int peek(void);

cores/esp32/esp32-hal-uart.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static void IRAM_ATTR _uart_isr()
127127
* @param[in] user_arg The user argument that will be passed to the user interrupt handler.
128128
*
129129
*/
130-
void uartEnableInterrupt(uart_t* uart, uart_interrupt_t **arg, void (*func)(uint8_t, void*), void* user_arg)
130+
void uartEnableRxInterrupt(uart_t* uart, uart_interrupt_t **arg, void (*func)(uint8_t, void*), void* user_arg)
131131
{
132132
UART_MUTEX_LOCK();
133133
uart->dev->conf1.rxfifo_full_thrhd = 112;
@@ -158,14 +158,14 @@ void uartEnableInterrupt(uart_t* uart, uart_interrupt_t **arg, void (*func)(uint
158158
* @brief Disables the UART RX interrupt on the specified UART device.
159159
*
160160
* This function disables the RX interrupt for the specified UART device.
161-
* This function will delete the uart_interrupt_t* that uartEnableInterrupt() creates.
161+
* This function will delete the uart_interrupt_t* that uartEnableRxInterrupt() creates.
162162
* The pointer to the uart_interrupt_t will be deleted when the interrupt is disabled, or another interrupt function is being registered.
163163
* Please check for NULL on the uart_interrupt_t pointer before using it.
164164
165165
* @param[in] uart The uart device to register the function for.
166166
*
167167
*/
168-
void uartDisableInterrupt(uart_t* uart)
168+
void uartDisableRxInterrupt(uart_t* uart)
169169
{
170170
UART_MUTEX_LOCK();
171171
uart->dev->conf1.val = 0;
@@ -189,7 +189,7 @@ void uartDetachRx(uart_t* uart, uint8_t rxPin)
189189
return;
190190
}
191191
pinMatrixInDetach(rxPin, false, false);
192-
uartDisableInterrupt(uart);
192+
uartDisableRxInterrupt(uart);
193193
}
194194

195195
void uartDetachTx(uart_t* uart, uint8_t txPin)
@@ -207,7 +207,7 @@ void uartAttachRx(uart_t* uart, uint8_t rxPin, bool inverted)
207207
}
208208
pinMode(rxPin, INPUT);
209209
pinMatrixInAttach(rxPin, UART_RXD_IDX(uart->num), inverted);
210-
uartEnableInterrupt(uart, NULL, NULL, NULL);
210+
uartEnableRxInterrupt(uart, NULL, NULL, NULL);
211211
}
212212

213213
void uartAttachTx(uart_t* uart, uint8_t txPin, bool inverted)

cores/esp32/esp32-hal-uart.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ unsigned long uartDetectBaudrate(uart_t *uart);
8383

8484
bool uartRxActive(uart_t* uart);
8585

86-
void uartDisableInterrupt(uart_t* uart);
87-
void uartEnableInterrupt(uart_t *uart, uart_interrupt_t** arg, void (*func)(uint8_t, void*), void* user_arg);
86+
void uartDisableRxInterrupt(uart_t* uart);
87+
void uartEnableRxInterrupt(uart_t *uart, uart_interrupt_t** arg, void (*func)(uint8_t, void*), void* user_arg);
8888

8989
#ifdef __cplusplus
9090
}

libraries/ESP32/examples/Serial/Interrupt/Interrupt.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ void setup()
1212
{
1313
hwSerial.begin(115200);
1414
hwSerial2.begin(115200);
15-
hwSerial2.setRXInterrupt(onSerialRX, (void*)&hwSerial2);
15+
hwSerial2.setRxInterrupt(onSerialRX, (void*)&hwSerial2);
1616
}
1717

1818
void loop()

0 commit comments

Comments
 (0)
0