I am on the latest SDK (pfalcon/esp-open-sdk)
All lines with "PIN_PULLDWN_DIS" are commented out since the new SDK removed it.
(apparently there was a question of whether the ESP even had pulldowns)
compiled fine
Tx works fine
Rx fails
I instrumented user_main.c a bit but I don't see anything that is obviously wrong.
user_main.c
#include "softuart.h"
#define user_procTaskPrio 0
#define user_procTaskQueueLen 1
os_event_t user_procTaskQueue[user_procTaskQueueLen];
//create global softuart instances
Softuart softuart;
Softuart softuart2;
//-------------------------------------------------------------------------------------------------
// loop function will be execute by "os" periodically
static void ICACHE_FLASH_ATTR loop(os_event_t *events)
{
char buffer_char;
//print something on uart_0 to see progress
os_printf(".");
if (Softuart_Available(&softuart)) {
buffer_char = Softuart_Read(&softuart);
if (softuart.buffer.receive_buffer_head == softuart.buffer.receive_buffer_tail)
os_printf("Buffer empty\n");
else
os_printf("Buffer idx: %d %d\n", softuart.buffer.receive_buffer_head, softuart.buffer.receive_buffer_tail);
os_printf("Softuart 1 Rx: %d\r\n", buffer_char);
//Softuart_Putchar(&softuart,buffer_char);
}
//write example output to softuart 1
Softuart_Putchar(&softuart,'1');
//some delay until we run this task again
os_delay_us(100000);
// run (schedule) this loop task again
system_os_post(user_procTaskPrio, 0, 0 );
}
//-------------------------------------------------------------------------------------------------
//Init function
void ICACHE_FLASH_ATTR user_init()
{
// Initialize UART0 to use as debug
uart_div_modify(0, UART_CLK_FREQ / 9600);
os_delay_us(100000);
//init software uart
Softuart_SetPinRx(&softuart,12);
Softuart_SetPinTx(&softuart,14);
//startup
Softuart_Init(&softuart,9600);
//Start our loop task
system_os_task(loop, user_procTaskPrio,user_procTaskQueue, user_procTaskQueueLen);
system_os_post(user_procTaskPrio, 0, 0 );
}
This is the output:
Several contiguous dots = my loopback wire not attached
otherwise when it prints, it was attached
I noticed also each run of the loop seemed to put >1 chars into the Rx buffer.
Is the a timing issue? New SDK issue?
I am on the latest SDK (pfalcon/esp-open-sdk) All lines with "PIN_PULLDWN_DIS" are commented out since the new SDK removed it. (apparently there was a question of whether the ESP even had pulldowns) compiled fine Tx works fine Rx fails
I instrumented user_main.c a bit but I don't see anything that is obviously wrong.
user_main.c
This is the output: Several contiguous dots = my loopback wire not attached otherwise when it prints, it was attached I noticed also each run of the loop seemed to put >1 chars into the Rx buffer. Is the a timing issue? New SDK issue?