Commit graph

74 commits

Author SHA1 Message Date
Angus Gratton
1c08cf2f79 Merge branch 'bugfix/uart_intr_config' into 'master'
uart_intr_config should return ESP_OK on success

Github PR #170 https://github.com/espressif/esp-idf/pull/170

See merge request !339
2016-12-29 05:36:26 +08:00
Angus Gratton
6395081503 uart driver: Set type of uart_driver_install queue param
Closes github #91 https://github.com/espressif/esp-idf/issues/91
2016-12-28 10:17:56 +11:00
Wangjialin
794f7dd294 bugfix: uart event mismatch
1. Fix bug of uart frame error and parity error interrupt mismatch in driver code, which will cause the corresponding interrupt can not be cleared correctly, and will finally cause a interrupt watch dog.
2. Add gpio pull-up for rx pin and cts pin.
2016-12-22 14:08:48 +08:00
Wangjialin
9dbdab5c9a driver: uart
1. add uart rx buffer data length API
2. add uart pattern detect event
3. add uart example code
4. modify uart_isr_register
5. modify uart.rst
6. fix parity err event and frame err event.
2016-12-21 11:55:53 +08:00
Deomid Ryabkov
2c165aba36 uart_intr_config should return ESP_OK on success 2016-12-16 22:27:45 +00:00
Jeroen Domburg
1037a50abe Convert DOS line ends to Unix line ends in drivers 2016-12-15 09:45:40 +08:00
Ivan Grokhotkov
1c60a0450e Merge branch 'bugfix/driver_cleanup_log' into 'master'
drivers: remove file paths from log statements

Function name and error string are usually sufficient to find the place which has triggered an error. 

`__FILE__` macro generates a string which has absolute file name (with our build system), which add many long strings to the program binary.

Also change log tags to lower case to match style used elsewhere.

Fixes https://github.com/espressif/esp-idf/issues/126

See merge request !282
2016-12-12 10:15:25 +08:00
Jeroen Domburg
2c34ab3374 Mark some interrupts that are now allocated dynamically as free, add int handle param documentation, add local ints test 2016-12-08 12:39:33 +08:00
Jeroen Domburg
ae8c37e0b6 Add disabling/enabling of shared interrupt, add testcase for interrupts 2016-12-08 12:39:33 +08:00
Jeroen Domburg
655fd2986a Add interrupt allocation scheme / interrupt sharing. Also modifies drivers and examples. Also allows interrupts
to be marked specifically as having a handler that's all in IRAM.
2016-12-08 12:39:33 +08:00
Ivan Grokhotkov
0dff9ed79d drivers: remove file paths from log statements
Function name and error string are usually sufficient to find the place which has triggered an error. __FILE__ macro generates a string which has absolute file name (with our build system), so there is a lot of long strings present in the program because of that.

Fixes https://github.com/espressif/esp-idf/issues/126
2016-12-07 12:01:54 +08:00
Angus Gratton
1d05f41a70 UART driver: Fix crash in ISR due to "UART" static array moved to flash
Ref: http://esp32.com/viewtopic.php?f=13&t=546&sid=76ff371ae2b259441a2cf355e96d74b9#p2275

This is a really subtle bug, gcc noticed the UART array elements are read-only so
implicitly moved the elements to .rodata as if it was const. However
this array is accessed from the UART ISR, so has to be in IRAM or DRAM.
2016-11-23 10:58:03 +11:00
Wangjialin
37cbb0bdea driver: bugfix/fix uart parity and frame error bug
1. modify definition for uart_parity_t
2. fix bugs in uart interrupt handler for parity err and frame err.
2016-11-16 14:44:06 +08:00
Wangjialin
a8a51a2786 bugfix/uart_isr_switch_context: add switching context in uart ISR.
1. add switching context in uart ISR
2. remove duplicated #include in uart.c
3. modify example in uart.h(will later add examples to idf/examples)
2016-11-15 13:47:51 +08:00
Wangjialin
4f4c9030fd Fix uart tx bug, data pass(with flow control) through test ok. 2016-11-10 17:01:39 +08:00
Wangjialin
e452278194 Minor changes for driver
1. remove "\n" when calling ESP_LOGX APIs.
2. modify uart_event_t for uart rx data.
3. use MICRO for uart inverse value
4. add uart_tx_data_t for internal tx function.
2016-11-07 14:16:52 +08:00
Wangjialin
3ec23f1b83 Modify as Angus's suggestion:
1. Set XXX_TAG static, remove extern XXX_TAG in uart.h/ledc.h/gpio.h
2. I removed uart_set/get_print_port() functions, these functions are not well tested, I removed them for now.
3. Modify some function names for uart_read/write_bytes
4. Modify uart_write_bytes and uart_write_bytes_with_break.
2016-11-04 12:52:34 +08:00
Wangjialin
a6b3be6734 Update UART driver
1. fix bug in ringbuffer.c:
    When return an dummy item, free_ptr might exceed rd_ptr, so the write_ptr would overwrite rd_ptr in this case.
2. Delete UART tx task in buffer mode. UART ISR will copy the data from tx buffer to fifo.
2016-11-04 02:48:25 +08:00
Wangjialin
9ed7c4f8bc fix ringbuffer bug. 2016-11-03 23:30:54 +08:00
Wangjialin
8282c73ac2 debug ring buffer error. 2016-11-03 18:28:36 +08:00
Wangjialin
8d6b782327 Modify UART driver:
1. Add a ring buffer for UART TX.
    If the buffer size is set to zero, driver will not use a buffer. But we need a task to send data from buffer to fifo. I tried directly copy data in ISR, but the code looked too long for ISR.
2. Modify the format in uart.h
2016-11-01 09:22:09 +08:00
Wangjialin
74aff2b9d2 Update UART driver
1. Use esp_log API for LEDC and GPIO code.
2. Modify some API return value.
3. Add ledc_set_pin() for LEDC
4. Modify typo in uart.h

Questions: In uart driver ISR handler, I used xxxFromISR , like xSemaphoreGiveFromISR, do those FromISR functions need to be put in IRAM?
2016-10-24 15:57:23 +08:00
Wangjialin
9098e64398 modify GPIO number check 2016-10-24 09:38:34 +08:00
Wangjialin
288f4f63f0 Add UART driver
1. add uart.h and uart.c
2. add ESP_ERR_TIMEOUT in esp_err.h
3. add UART AHB FIFO address in uart_reg.h
4. modify xRingbufferSendFromISR return value in ringbuffer.c
5. add #include "soc/gpio_sig_map.h" in gpio.h
2016-10-24 09:17:10 +08:00