Skip to content

Commit ff74247

Browse files
committed
cast types in console for uart channel
1 parent a1e545c commit ff74247

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

lib/console/Commands/XFERCommands.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ std::string read_until(char delimiter)
2727
while (byte != delimiter)
2828
{
2929
size_t size = 0;
30-
uart_get_buffered_data_len(CONSOLE_UART, &size);
30+
uart_get_buffered_data_len((uart_port_t)CONSOLE_UART, &size);
3131
if (size > 0)
3232
{
33-
int result = uart_read_bytes(CONSOLE_UART, &byte, 1, MAX_READ_WAIT_TICKS);
33+
int result = uart_read_bytes((uart_port_t)CONSOLE_UART, &byte, 1, MAX_READ_WAIT_TICKS);
3434
if (result < 1)
3535
{
3636
fprintf(stdout, "3 Error: Response Timeout\r\n");
@@ -75,10 +75,10 @@ int rx(int argc, char **argv)
7575
while (count < size)
7676
{
7777
size_t size = 0;
78-
uart_get_buffered_data_len(CONSOLE_UART, &size);
78+
uart_get_buffered_data_len((uart_port_t)CONSOLE_UART, &size);
7979
if (size > 0)
8080
{
81-
int result = uart_read_bytes(CONSOLE_UART, &byte, 1, MAX_READ_WAIT_TICKS);
81+
int result = uart_read_bytes((uart_port_t)CONSOLE_UART, &byte, 1, MAX_READ_WAIT_TICKS);
8282
if (result < 1)
8383
break;
8484

lib/console/Console.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ namespace ESP32Console
124124
this->uart_channel_ = channel;
125125

126126
//Reinit the UART driver if the channel was already in use
127-
if (uart_is_driver_installed(channel)) {
128-
uart_driver_delete(channel);
127+
if (uart_is_driver_installed((uart_port_t)channel)) {
128+
uart_driver_delete((uart_port_t)channel);
129129
}
130130

131131
/* Drain stdout before reconfiguring it */
@@ -157,21 +157,21 @@ namespace ESP32Console
157157
};
158158

159159

160-
ESP_ERROR_CHECK(uart_param_config(channel, &uart_config));
160+
ESP_ERROR_CHECK(uart_param_config((uart_port_t)channel, &uart_config));
161161

162162
// Set the correct pins for the UART of needed
163163
if (rxPin > 0 || txPin > 0) {
164164
if (rxPin < 0 || txPin < 0) {
165165
Debug_printv("Both rxPin and txPin has to be passed!");
166166
}
167-
uart_set_pin(channel, txPin, rxPin, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
167+
uart_set_pin((uart_port_t)channel, txPin, rxPin, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
168168
}
169169

170170
/* Install UART driver for interrupt-driven reads and writes */
171-
ESP_ERROR_CHECK(uart_driver_install(channel, 256, 0, 0, NULL, 0));
171+
ESP_ERROR_CHECK(uart_driver_install((uart_port_t)channel, 256, 0, 0, NULL, 0));
172172

173173
/* Tell VFS to use UART driver */
174-
esp_vfs_dev_uart_use_driver(channel);
174+
esp_vfs_dev_uart_use_driver((uart_port_t)channel);
175175

176176
esp_console_config_t console_config = {
177177
.max_cmdline_length = max_cmdline_len_,
@@ -272,7 +272,7 @@ namespace ESP32Console
272272
//Debug_printv("Interpolated line: [%s]\n", interpolated_line.c_str());
273273

274274
// Flush trailing CR
275-
uart_flush(CONSOLE_UART);
275+
uart_flush((uart_port_t)CONSOLE_UART);
276276

277277
/* Try to run the command */
278278
int ret;

lib/console/ute/ute.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#define _DEFAULT_SOURCE
1010
#define _BSD_SOURCE
11-
#define _GNU_SOURCE
11+
//#define _GNU_SOURCE
1212

1313
#include "ute.h"
1414

0 commit comments

Comments
 (0)