Commit graph

39 commits

Author SHA1 Message Date
Our Air Quality
7a8ee567b6 libmain: add a compile option to avoid saving wifi params to flash
Add source code for sdk_wifi_param_save_protect() and a compile time,
WIFI_PARAM_SAVE, option to skip writing the wifi state to flash. This
avoids wear on the flash and does not appear to be necessary when the
app initializes the state anyway.

Define WIFI_PARAM_SAVE to 0 for the wificfg example.
2018-06-17 20:12:29 +10:00
Ruslan V. Uss
5830e001cf
Merge pull request #621 from ourairquality/dhcpc-flag-stopped
sdk_wifi_station_dhcpc_stop: ensure the client is flagged as stopped.
2018-04-30 15:14:18 +05:00
Our Air Quality
6db5525fbb sdk_wifi_station_dhcpc_stop: ensure the client is flagged as stopped.
Need to flag the dhcp client as stopped, even if the netif is not yet
initialized, because the flag is used to control the starting of the
dhcpc.
2018-04-30 14:08:41 +10:00
Our Air Quality
cec6b7c19f sdk_os_delay_us: rewrite to avoid hal.h
Seems to fail to compile recently, missing xthal_get_ccount(), so
avoid using hal.h which is outside esp-open-rtos.
2018-04-25 13:05:25 +10:00
Flavio Bayer
de426c08b6
bugfix/ets_timer.c: race condition while disarming
If `sdk_ets_timer_arm_ms_us` is called right after `vPortExitCritical` inside `sdk_ets_timer_disarm` on line 247 (by an ISR for example, which was my case), execution will loop forever on line 196, since `timer->next!=ETS_TIMER_NOT_ARMED`, which was supposed to be changed in line 248.
By delaying the IRS or context switch until `sdk_ets_timer_disarm` the problem is fixed.
2018-04-13 16:08:03 -03:00
Our Air Quality
3c81f7d587 lwip update
* The mdns responder has been reworked to lower stack and memory usage. This is
  a variation on the upstream code, it use malloc whereas the upstream code uses
  pools. The high stack usage of the mdns responder was problem for
  esp-open-rtos, so we might have to maintain the differences for now.

* Improved lwip core locking, and lock checking. Upstream improvements, that
  need some added support from esp-open-rtos specific code. More core lock is
  performed when calling from the esp-open-rtos code now, so a little safer. The
  checking is not enforced, but projects might see warning messages and might
  want to look into them.

* The esp-open-rtos lwip support has been sync'ed with the new freertos port
  included with lwip. There are still some minor differences.

* A few lwip timer bugs have been resolved. This might help resolve some issues.

* Plus it picks up all the other upstream fixes and improvements.

* The default lwip stack has been lowered from 768 words to 480 words,
  due to the reduced stack usage by the mdns responder.
2018-02-09 20:26:02 +11:00
Ruslan V. Uss
c3ae04c93f
Merge pull request #511 from ourairquality/newlib-locks
Newlib: implement locks
2017-12-14 08:30:20 +05:00
Our Air Quality
f0d2c34399 sdk_system_print_meminfo: fix and correct heap end. 2017-12-14 08:15:04 +11:00
Our Air Quality
e9d9201527 Newlib: implement locks
* Dynamically allocate arc4random data. Saves about 1k off the bss.
2017-12-13 11:29:43 +11:00
Our Air Quality
0a07fe11e5 softap: allow output of multicast frames.
Multicast frames were being dropped by ieee80211_output_pbuf. It appears to look
up the destination address using cnx_node_search which only has an entry for the
broadcast address (all ones). This patch modifies cnx_node_search to return the
broadcast cnx_node for the multicast addresses too.

This is needed to support services such as mDNS on the softap interface.
2017-12-12 12:03:19 +11: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
3dbf129fa1 ets_timer: code for using the FreeRTOS timers, and remove from libs. 2017-08-30 13:51:32 +10:00
sheinz
326708c903 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
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
Johan Kanflo
c415d49f1e Added sdk_system_get_netif 2017-02-20 20:27:24 +01: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
Oto Petřík
d50294b590 Fix ignored offset in rtc_mem access.
Fix sdk_system_rtc_mem_write and sdk_system_rtc_mem_read,
the functions did not use the user-provided offsets to rtc_mem.
Without using offset, rboot's rtcdata access, and its
temp_rom handling were broken.
2016-12-01 20:03:57 +01:00
Our Air Quality
df76e77598 open_esplibs libwpa: source code for os_xtensa.c (#283) 2016-11-23 17:56:34 +02:00
Our Air Quality
ca6c6e1d3e open_esplibs libnet80211: source code for sdk_cnx_node_search. (#280)
Also code for sdk_cnx_sta_leave, although disabled due to accessing static date, but it shows a reference to the netif->flags and the NETIF_FLAG_DHCP flag removed in lwip v2.
2016-11-23 17:56:05 +02:00
Our Air Quality
4f58059472 open_esplibs libwpa: source code for some struct netif paths. (#279)
Function sdk_eagle_auth_done accesses the netif-flags and the NETIF_FLAG_DHCP flag removed in lwip v2, and also the netif->ip_addr so is needed for lwip development.

Function sdk_wpa_config_bss accesses the netif->hwaddr.

Also code for a few other trivial functions that help debug the dhcpc paths.
2016-11-23 17:55:48 +02:00
Our Air Quality
ec4368d9ae open_esplibs libnet80211: source code for sdk_wifi_station_start and stop. (#278)
The function sdk_wifi_station_start is one of two paths that allocates a lwip struct netif and also accesses the netif->hwaddr slot so this is required for lwip development.

Also code for sdk_wifi_station_stop and sdk_sta_status_set to better understand the status state.
2016-11-21 21:31:54 +02:00
Our Air Quality
f10c6ed4ce open_esplibs libnet80211: source code for sdk_ieee80211_deliver_data. (#277) 2016-11-21 16:05:57 +02:00
Our Air Quality
b39df7f91e open_esplibs user_interface: source code for functions touching the struct netif. (#275)
Add source code for functions touching the struct netif to better support lwip development: sdk_wifi_get_ip_info, sdk_wifi_set_ip_info, sdk_wifi_get_macaddr, sdk_wifi_set_macaddr.

Also code for sdk_wifi_station_get_connect_status.

Also code for wifi_get_sleep_type and set_sleep_type, noting wifi_set_sleep_type returns a bool success flag, and implement wifi_get_sleep_type using sdk_pm_get_sleep_type.
2016-11-21 16:05:34 +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
0dadda86de wifi_get/set_sleep_type: add source code implementations plus fixes. (#218)
* wifi_set_sleep_type returns a bool success flag.

* wifi_get_sleep_type seemed useless, just returning an argument. Added an implementation using sdk_pm_get_sleep_type.
2016-11-14 12:13:38 +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
bc50c7c2fc open_esplibs: add a skeleton for code in more libraries. (#266) 2016-11-12 20:54:24 +02:00
Our Air Quality
a5cc728079 FreeRTOS type updates. (#261) 2016-11-05 12:04:03 +02:00
Our Air Quality
a15d1bb002 timers: esp library timer callbacks expect their argument not a xTimerHandle (#221) 2016-09-22 08:56:06 +02:00
Our Air Quality
03248a96c7 libmain: add sdk_system_uart_swap and sdk_system_uart_de_swap (#171) 2016-08-27 22:18:13 +02:00
sheinz
62f55d499e Fix for system_deep_sleep ignoring argument 2016-08-17 16:25:17 +03:00
Angus Gratton
6c9d478336 open_esplibs: Add README and Copyright headers 2016-07-06 17:22:09 +10:00
Angus Gratton
678b59babf Honour values of configCPU_CLOCK_HZ & configTICK_RATE_HZ for tick rate
Fixes #147

* Can vary tick rate from 100Hz via configTICK_RATE_HZ. Note that the
  SDK binary libraries are hard-coded to assume the tick rate is 100Hz,
  so changing the tick rate may have unexpected consequences for lower
  layer WiFi behaviour (such as certain kinds of timeouts happening
  faster/slower.)

* Setting configCPU_CLOCK_HZ to 160MHz means ESP will set 160MHz during
  initialisation. Only 80MHz and 160MHz are supported.

* Timing of tasks is no longer affected by current CPU freq (whether set
  via configCPU_CLOCK_HZ or via sdk_system_update_cpu_freq().)
  Previously doubling the CPU frequency would double the tick rate.
2016-07-06 17:22:09 +10:00
Angus Gratton
701a4c4284 sdk_system_rtc_mem_read: Fix destination buffer pointer 2016-07-06 17:21:34 +10:00
Alex Stewart
8c9a77efe8 Added first half of RE'd user_interface.c 2016-07-06 17:21:34 +10:00
Alex Stewart
3e5af479bc Add conditional compilation for open_esplib code 2016-07-06 17:21:34 +10:00
Alex Stewart
4d6fa0ccfa Misc post-merge fixups 2016-07-06 17:21:34 +10:00
Alex Stewart
eee4a3660c Rename opensdk dir to open_esplibs 2016-07-06 17:21:34 +10:00