Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reducion de lens en echotask #1

Open
wants to merge 2 commits into
base: Probar_puerta
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions main/uart_echo_example_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,11 +654,13 @@ static NMEA_data_t NMEA_separator(NMEA_data_t datos_ordenados, char* datos_NMEA
//Cuando se envia algo len se vuelve la longitud de lo que se envio
//si no se envio nada, entonces no estrara en esta parte. Ademas,
// len7 no se reinicia para que luego de pedir los datos GPS siempre entre
if ((len3 > 0) || (len5 > 0) || (len7 > 0) ) {

if (len3*len5*len7>0) {
//Lee el uart
// ESP_LOGI(TAG1, "Voy a leer el uart");
len = uart_read_bytes(UART_NUM_2, (uint8_t*)tx_buf, BUF_SIZE, pdMS_TO_TICKS(10));

ESP_LOGI(TAG1, "len es: %d",len);

// ESP_LOGI(TAG1, "len es: %d",len);


Expand All @@ -668,29 +670,22 @@ static NMEA_data_t NMEA_separator(NMEA_data_t datos_ordenados, char* datos_NMEA
// Borrar lo que tenia antes auxc2
bzero(auxc2_echo,BUF_SIZE);
// Mostar que se borro todo
// ESP_LOGI(TAG1, "Se vacio, auxc2 es: %s",auxc2_echo);
// ESP_LOGI(TAG1, "Se vacio, auxc2 es: %s",auxc2_echo);
// Copiar lo que esta en el buffer de recepcion


//Se copia lo que llego al buffer, las primeras 2 veces no hace falta que
//tenga una dimension tan grande el auxiliar
if (auxi1_echo < 2){
memcpy(auxc2_echo,tx_buf,20);
} else {
memcpy(auxc2_echo,tx_buf,BUF_SIZE);
}


//Mostrar auxc2
// ESP_LOGI(TAG1, "Copio el buffer, auxc2 es: %s",auxc2_echo);
//printf(" Copio el buffer, auxc2 es: %s",auxc2)
// ESP_LOGI(TAG1, " Ya termino auxc2");



//Empezara a ver escaladamente como comprueba ATOK, ATGPS y "ATGPSRD"


if (parar_RD1 == 0){

switch (auxi1_echo){
Expand Down