mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
PPPoS example: Move pin configuration to menuconfig, add log statement
Also remove spurious infinite loop in app_main()
This commit is contained in:
parent
f3a567b65d
commit
fa3120cb40
@ -1,21 +1,49 @@
|
|||||||
menu "GSM configuration"
|
menu "Example Configuration"
|
||||||
|
|
||||||
config GSM_INTERNET_USER
|
config GSM_INTERNET_USER
|
||||||
string "Internet User"
|
string "GSM Internet User"
|
||||||
default ""
|
default ""
|
||||||
help
|
help
|
||||||
Network provider internet user.
|
Network provider internet user.
|
||||||
|
|
||||||
config GSM_INTERNET_PASSWORD
|
config GSM_INTERNET_PASSWORD
|
||||||
string "Internet password"
|
string "GSM Internet password"
|
||||||
default ""
|
default ""
|
||||||
help
|
help
|
||||||
Network provider internet password
|
Network provider internet password
|
||||||
|
|
||||||
config GSM_APN
|
config GSM_APN
|
||||||
string "Internet APN"
|
string "GSM Internet APN"
|
||||||
default "playmetric"
|
default "playmetric"
|
||||||
help
|
help
|
||||||
APN from network provider for internet access
|
APN from network provider for internet access
|
||||||
|
|
||||||
|
config UART1_TX_PIN
|
||||||
|
int "PPP serial TX GPIO"
|
||||||
|
default 17
|
||||||
|
range 0 31
|
||||||
|
help
|
||||||
|
Pin to configure for UART1 TX
|
||||||
|
|
||||||
|
config UART1_RX_PIN
|
||||||
|
int "PPP serial RX GPIO"
|
||||||
|
default 16
|
||||||
|
range 0 31
|
||||||
|
help
|
||||||
|
Pin to configure for UART1 RX
|
||||||
|
|
||||||
|
config UART1_RTS_PIN
|
||||||
|
int "PPP serial RTS GPIO"
|
||||||
|
default 18
|
||||||
|
range 0 31
|
||||||
|
help
|
||||||
|
Pin to configure for UART1 RTS
|
||||||
|
|
||||||
|
config UART1_CTS_PIN
|
||||||
|
int "PPP serial CTS GPIO"
|
||||||
|
default 23
|
||||||
|
range 0 31
|
||||||
|
help
|
||||||
|
Pin to configure for UART1 CTS
|
||||||
|
|
||||||
endmenu
|
endmenu
|
@ -36,6 +36,12 @@ const char *PPP_ApnATReq = "AT+CGDCONT=1,\"IP\",\"" \
|
|||||||
CONFIG_GSM_APN \
|
CONFIG_GSM_APN \
|
||||||
"\"";
|
"\"";
|
||||||
|
|
||||||
|
/* Pins used for serial communication with GSM module */
|
||||||
|
#define UART1_TX_PIN CONFIG_UART1_TX_PIN
|
||||||
|
#define UART1_RX_PIN CONFIG_UART1_RX_PIN
|
||||||
|
#define UART1_RTS_PIN CONFIG_UART1_RTS_PIN
|
||||||
|
#define UART1_CTS_PIN CONFIG_UART1_CTS_PIN
|
||||||
|
|
||||||
/* UART */
|
/* UART */
|
||||||
int uart_num = UART_NUM_1;
|
int uart_num = UART_NUM_1;
|
||||||
|
|
||||||
@ -208,8 +214,10 @@ static void pppos_client_task()
|
|||||||
//Configure UART1 parameters
|
//Configure UART1 parameters
|
||||||
uart_param_config(uart_num, &uart_config);
|
uart_param_config(uart_num, &uart_config);
|
||||||
|
|
||||||
//Set UART1 pins(TX: IO17, RX: IO16, RTS: IO18, CTS: IO23)
|
// Configure UART1 pins (as set in example's menuconfig)
|
||||||
uart_set_pin(uart_num, 17, 16, 18, 23);
|
ESP_LOGI(TAG, "Configuring UART1 GPIOs: TX:%d RX:%d RTS:%d CTS: %d",
|
||||||
|
UART1_TX_PIN, UART1_RX_PIN, UART1_RTS_PIN, UART1_CTS_PIN);
|
||||||
|
uart_set_pin(uart_num, UART1_TX_PIN, UART1_RX_PIN, UART1_RTS_PIN, UART1_CTS_PIN);
|
||||||
uart_driver_install(uart_num, BUF_SIZE * 2, BUF_SIZE * 2, 0, NULL, 0);
|
uart_driver_install(uart_num, BUF_SIZE * 2, BUF_SIZE * 2, 0, NULL, 0);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -285,8 +293,4 @@ void app_main()
|
|||||||
{
|
{
|
||||||
tcpip_adapter_init();
|
tcpip_adapter_init();
|
||||||
xTaskCreate(&pppos_client_task, "pppos_client_task", 2048, NULL, 5, NULL);
|
xTaskCreate(&pppos_client_task, "pppos_client_task", 2048, NULL, 5, NULL);
|
||||||
|
|
||||||
while (1) {
|
|
||||||
vTaskDelay(1000 / portTICK_RATE_MS);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user