Commit graph

224 commits

Author SHA1 Message Date
Our Air Quality
ebdd2f983b lwip: define LWIP_POSIX_SOCKETS_IO_NAMES as zero (#457)
This patch gets the newlib standard stream descriptors playing well with the
lwip socket descriptors and the spiffs file descriptors. The LWIP_SOCKET_OFFSET
is now defined to be 3, rather than zero, to avoid clashing with the standard
stream descriptors, and the SPIFFS_FILEHDL_OFFSET is bumped up to start after
the lwip descriptors.
2017-10-18 19:33:32 +02:00
Ruslan V. Uss
546cc47121 Merge pull request #437 from ourairquality/oaq-merge-1
* bmp180: comment typo
* ds3231: minor code style fixes. Comment, on the week day start.
* Reverse engineered ets_timers.o Switch from FreeRTOS queue to task notification. Removed unknown/unused code. Rename sdk_ets_handler_isr to process_pending_timers. Add function for microseconds Simplify time to ticks conversion
* ets_timer: code for using the FreeRTOS timers, and remove from libs.
* libc: update to a recent newlib version.
* LwIP v2 support
* spi_write: use uint32_t for the page iteration counter. The page counter was using an uint8_t which seems unnecessary and might wrap.
* sysparam_get_bool: memcpy the binary values out.
* FreeRTOS 9.0.1
* Add an argument to ISRs. Disable interrupts while masking them.
* sysparam: reserve one more flash sector before placing the sysparams. This is to help work with recent SDKs that add a RF cal sector by default in the fifth last sector - just so the sysparam sectors do not jump around when using different SDK versions.
* upnp example: strip down the lwipopts.h file
* sysparam editor: accept newline to end a line of input.
* Add Wificfg. Uses the sysparam store to save the wifi configuration. Adds a basic http server for configuration.
* lwip: disable the tcpip_core_locking_input option. With this option enabled some lwip input processing occurs in the pp task which works well for some uses but some code uses a lot of stack (e.g. mdns) and will overflow the pp task stask, or might unnecessarily slow the critical pp task,
so disable this by default and if not already defined.
* sdk_cnx_add_rc: fix overflow of the table, when no match is found. Also adds source code for sdk_cnx_rc_search, adding a null pointer dereference. Check (that is not expected to be seen), and source code for sdk_cnx_remove_rc.
* http_get example: fix compilation with ipv6 disabled.
* lwip: update to master branch.
* wificfg: allow the AP channel to be 1.
* lwip: rework the tcp ooseq handling. It now accounts for the number of rx pool buffers used and the
available memory when deciding the number of ooseq buffers to retain. Enable the TCP Selective ACK support which appears to help a lot on lossy wifi when using the OOSEQ option.
* Update lwip, fixes losses of pcbs and associated problems.
* lwip: revise the tcp ooseq limit calulations. Was making a mess of the calculation sign. Also added a COPY_PP_RX_PBUFS define to include appropriate limits for this option.
* lwip: ooseq_max_bytes() - set a practical target memory size.
* lwip: revise ooseq handling. Modified for lwip backwards compatibility based on upstream feedback.
* lwip: update to the 2.0.3 release
* lwip: merge upstream master.
* libc: update to upstream master.
* lwip: fix building without TCP_QUEUE_OOSEQ
2017-10-02 04:50:35 +05:00
Our Air Quality
29da4e9279 sdk_cnx_add_rc: fix overflow of the table, when no match is found.
Also adds source code for sdk_cnx_rc_search, adding a null pointer dereference
check (that is not expected to be seen), and source code for sdk_cnx_remove_rc.
2017-08-30 13:51:32 +10:00
Our Air Quality
55958b8bc3 sysparam_get_bool: memcpy the binary values out. 2017-08-30 13:51:32 +10:00
Our Air Quality
b6fc58b743 spi_write: use uint32_t for the page iteration counter.
The page counter was using an uint8_t which seems unnecessary and might wrap.
2017-08-30 13:51:32 +10:00
Our Air Quality
af4ac44cb5 libc: update to a recent newlib version. 2017-08-30 13:51:32 +10:00
Our Air Quality
cd23acaa4a LwIP v2 support 2017-08-30 13:51:32 +10:00
Our Air Quality
5583543f14 Add an argument to ISRs. Disable interrupts while masking them. 2017-08-30 13:51:32 +10:00
Our Air Quality
ec5dabd237 sysparam: reserve one more flash sector before placing the sysparams
This is to help work with recent SDKs that add a RF cal sector by
default in the fifth last sector - just so the sysparam sectors do not
jump around when using different SDK versions.
2017-08-30 13:51:32 +10:00
Sakari Kapanen
4838072ecf Added an API for user exception handlers 2017-08-29 09:51:23 +03:00
Our Air Quality
6a0da03809 Use hwrand for the sdk uses of rand, in particular with the NMI.
The fiq NMI calls rand() from lmac:lmac.a:sdk_lmacTxFrame and the NMI
must not touch the newlib reent structure or enter critical regions
etc, so just use the simple and safe hwrand implementation as a
substitute.
2017-07-20 16:24:45 +10:00
UncleRus
852ed2f1ad Fixes unaligned writes to SPI data register 2017-04-20 01:49:46 +05:00
UncleRus
31ef50c9a9 Revert SPI memcpy() 2017-03-22 10:50:54 +05:00
sheinz
a91ec6eb61 sysparam fixes, tests, spi flash refactoring (#299)
Original work by @ourairquality
* Sysparam threadsafe and SPI access
* Sysparam test cases
* Fix for negative int8
* Sysparam getting bool without memory allocation. Bool tests.
* SPI flash refactoring.
* Extract common spiflash.c into core.
* Use spiflash.c in sysparam.
* Use memcpy in spiflash.c insted of hand-written version.
* Tests for spiflash.c
2017-03-22 02:18:04 +05:00
Andrew Clink
03597d9162 Make FreeRTOS hooks weak; Add example 2017-03-20 12:56:17 -07:00
Ruslan V. Uss
1457a3ed19 Fixed error of writing to SPI registers with memcpy (#352)
fixed memcpy() writing registers bug
2017-03-15 18:18:32 +05:00
Tuan PM
2b915c11c7 add some missing include & fixed display output on sh1104 (#319)
* add some missing include

* Fixed display on SH1106
2017-01-03 00:40:54 +02:00
otopetrik
8f5d49de81 Allow changing write function of stdout (#304)
* Allow changing write function of stdout.

Required for stdout redirection.
Works on blocks, not chars - does _not_ use sdk_os_putc !
Should work even when linking with SPIFFS.
2016-12-19 20:55:26 +05:00
Ruslan V. Uss
61c3d509e5 Merge pull request #302 from Zaltora/spi_fixes
Fixes SPI Bug(s)
2016-12-05 19:08:17 +06:00
lilian
8767a8a0a9 Readable option 2016-12-05 12:45:40 +01:00
lilian
47cd73ae02 Fix status with bus. 2016-12-05 12:05:18 +01:00
lilian
762f73515b Second bug. fix attempt. 2016-12-05 09:03:02 +01:00
lilian
199237ec6e Fixes Bug(s) 2016-11-30 08:19:25 +01:00
UncleRus
c3b6aff41d gpio_interrupt_handler() can now be overriden 2016-11-30 02:54:07 +05:00
UncleRus
a61af52d96 More convenient GPIO interrupt handlers 2016-11-30 01:07:46 +05:00
lilian
20ab2176fb fix tab 2016-11-26 15:14:40 +01:00
lilian
f19fdc37be adjustements 2016-11-26 12:26:42 +01:00
lilian
71bce674a0 Spi features 2016-11-26 12:19:53 +01:00
Our Air Quality
5c885c7722 sysparam: export the 'compact' function, added it to the editor. (#213) 2016-11-24 00:41:39 +02:00
Our Air Quality
1728ef3dfc Flush the uart tx fifo before a restart. (#274)
Also comment the point at which the bus clock that drives the uart changes on startup and comment out the change in the uart divisor. This at least allows a consistent uart baud rate during a restart if using the rate 115200.
2016-11-18 11:34:03 +02:00
Our Air Quality
e48910ea3b Update and re-organise the sdk internal definitions. (#267) 2016-11-14 00:05:13 +02:00
Our Air Quality
a5cc728079 FreeRTOS type updates. (#261) 2016-11-05 12:04:03 +02:00
sheinz
e2e6f35288 Fix spiff and stdin_uart_interrupt overiding the same read function (#249)
* Fix spiff and stdin_uart_interrupt overiding the same read function

* Make strong function defninition replace a weak one
2016-11-01 17:14:34 +02:00
OurAirQuality
7bab80c33d FreeRTOS v9.0.0 upgrade 2016-10-25 23:35:51 +11:00
sheinz
29bd8d832a Merge pull request #222 from resetnow/phy-regs
core: add phy regs definition
2016-10-10 22:16:46 +03:00
Vlad Ivanov
94237f0ecd core: add phy regs definition 2016-09-15 22:31:45 +03:00
Vlad Ivanov
12d0da0c58 core: exception_vectors: initial esp-gdbstub support (#205) 2016-09-15 08:26:38 +02:00
Our Air Quality
4c78db81d8 sysparams: get/set int32 and int8 apis. (#209)
Rename the get/set_int api functions to get/set_int32.

Add get/set_int8 api functions too in anticipation of more efficient implementations for these.
2016-09-15 08:17:26 +02:00
sheinz
c2953eda38 Merge pull request #215 from pfalcon/pfalcon
esp/gpio_regs.h: Add info about strapping pins captured in GPIO.IN register.
2016-09-05 09:23:56 +03:00
sheinz
ad8764b9c6 Merge pull request #211 from ourairquality/gpio16
GPIO16 support.
2016-09-05 09:20:26 +03:00
Paul Sokolovsky
285dedd8f5 esp/gpio_regs.h: Add info about strapping pins captured in GPIO.IN register.
Specifically, in the high 16 bits of GPIO.IN register.
2016-09-04 23:20:29 +03:00
ourairquality
c52890eed7 GPIO16 support. 2016-08-31 11:30:32 +10:00
Paul Sokolovsky
0962255d91 esp/interrupts.h: Add RTC interrupt number.
40002a58     $a3 = rtc_intr_handler
40002a5e     $a4 = 0x0
40002a60     $a2 = 0x3
40002a62     call ets_isr_attach
2016-08-31 01:51:23 +03:00
sheinz
46840baed4 Merge pull request #196 from pfalcon/pfalcon
esp8266 headers: A new interrupt no and a new WDT register
2016-08-22 07:58:38 +03:00
Our Air Quality
762eced543 sysparam: add a semaphore to synchronize writers. (#194) 2016-08-21 07:47:40 +02:00
Paul Sokolovsky
0aabbea16f esp/wdt_regs.h: Add "current value" register.
WDT is countdown timer. Current value is accessible via VAL register. At
this time it's unclear if it's RO or RW (common sense says it shoul be RO).

Source: looking at the WDT registers on a running chip.
2016-08-20 16:13:07 +03:00
Paul Sokolovsky
458a6813c8 esp/interrupts.h: Add wDev FIQ interrupt number.
40251dd9     $a2 = 0x0
40251ddb     $a3 = wDev_ProcessFiq
40251dde     $a4 = 0x0
40251de0     $a0 = ets_isr_attach
40251de3     call $a0
2016-08-20 16:06:09 +03:00
Johan Kanflo
40dc3bf945 Sysparam by @foogod (#180)
* Sysparam implementation

sysparam improvements

Mostly done, a few minor cleanups left.

Add sysparam_editor example

Sysparam code cleanup

Add documentation to sysparam.h

Fix up sysparam.h docs

Added a couple more debug statements

Fix potential memory leak if realloc() fails

Major sysparam overhaul

Add sysparam_get_info function

Add sysparam initialization to app_main.c

* Fixed warnings, added license
2016-08-18 12:07:46 +02:00
sheinz
0875e5d55b Merge branch 'iomux-set-func' of https://github.com/ourairquality/esp-open-rtos into ourairquality-iomux-set-func
Conflicts:
	core/include/esp/iomux.h
2016-08-17 14:36:46 +03:00
sheinz
27135d6252 i2s_dma: Implementation of I2S + DMA wrapper library 2016-08-16 10:19:33 +03:00