From 2965291073ea7c09a57033ab69ec6d2b638bc233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Moska=C5=82a?= Date: Mon, 30 Jan 2023 22:03:49 +0100 Subject: [PATCH] Attempt 1 --- src/PPPOS.c | 23 ++++------------------- src/PPPOS.h | 2 +- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/src/PPPOS.c b/src/PPPOS.c index ed21a75..2ac59f4 100644 --- a/src/PPPOS.c +++ b/src/PPPOS.c @@ -1,8 +1,8 @@ #include -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/event_groups.h" +#include +//#include "freertos/task.h" +//#include "freertos/event_groups.h" #include "esp_system.h" #include "esp_wifi.h" #include "esp_event_loop.h" @@ -171,23 +171,8 @@ char* data = (char*)malloc(BUF_SIZE); } -void PPPOS_init(int txPin, int rxPin, int baudrate, int uart_number, char* user, char* pass){ +void PPPOS_init(int uart_number, char* user, char* pass){ PPPOS_uart_num = uart_number; - gpio_set_direction(txPin, GPIO_MODE_OUTPUT); - gpio_set_direction(rxPin, GPIO_MODE_INPUT); - gpio_set_pull_mode(rxPin, GPIO_PULLUP_ONLY); - - uart_config_t uart_config = { - .baud_rate = baudrate, - .data_bits = UART_DATA_8_BITS, - .parity = UART_PARITY_DISABLE, - .stop_bits = UART_STOP_BITS_1, - .flow_ctrl = UART_HW_FLOWCTRL_DISABLE - }; - - uart_param_config(PPPOS_uart_num, &uart_config) ; - uart_set_pin(PPPOS_uart_num, txPin, rxPin, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE); - uart_driver_install(PPPOS_uart_num, BUF_SIZE * 2, BUF_SIZE * 2, 0, NULL, 0); tcpip_adapter_init(); PPP_User = user; PPP_Pass = pass; diff --git a/src/PPPOS.h b/src/PPPOS.h index 8112c09..cf1e1cf 100644 --- a/src/PPPOS.h +++ b/src/PPPOS.h @@ -8,7 +8,7 @@ extern "C" { #define BUF_SIZE (1024) -void PPPOS_init(int txPin, int rxPin, int baudrate, int uart_number, char* user, char* pass); +void PPPOS_init(int uart_number, char* user, char* pass); bool PPPOS_isConnected();