Commit graph

18 commits

Author SHA1 Message Date
Angus Gratton
23ea182e83 Simplify interrupt and RTOS timer tick handlers
RTOS Timer tick handler is now the same as any other ISR.

This causes a few subtle behaviour changes that seem OK but are worth noting:

* RTOS tick handler sdk__xt_timer_int() is now called from one stack
  frame deeper (inside _xt_isr_handler()), whereas before it was called
  from the level above in UserHandleInterrupt. I can't see any way that
  the extra ~40 bytes of stack use here hurt, though.

* sdk__xt_timer_int() was previous called after all other interrupts
  flagged in the handler, now it's called before the TIMER FRC1 & FRC2
  handlers. The tick handler doesn't appear to do anything particularly
  timing intensive, though.

* GPIO interrupt (value 3) is now lower priority than the SPI
  interrupt (value 2), whereas before it would have been called before
  SPI if both interrupts triggered at once.
2015-09-29 13:21:04 +10:00
Angus Gratton
9f7a5a7fdd Consolidate interrupt management in core as esp/interrupts.h & esp_interrupts.c 2015-09-28 22:15:40 +10:00
Angus Gratton
430d0fbcbc Add C++ support to Makefile, and proof-of-concept simple.cpp example
This is a work in progress based on @mikejac's work.

Missing:
* No 'new' operator.
* I don't think STL is currently supported.
2015-08-10 16:14:30 +10:00
Angus Gratton
efc454035c Move all code paths touched by NMI to IRAM
Prerequisite for calling Cache_Read_Disable() for OTA updates.

Massive thanks due to @foogod and their xtobjdis tool, creating the call
graph of where the wDev_ProcessFiq touched (including in newlib, etc.)
would have otherwise been very painful:
https://bitbucket.org/foogod/xtobjdis
2015-07-29 16:47:33 +10:00
Angus Gratton
ed7ba52c9a Add exception vectors & low-level handlers
At the moment these are almost bit-for-bit copies of the vector
behaviour in the RTOS SDK, but hopefully that will start to change.

Progress towards #2
2015-07-28 11:01:57 +10:00
Angus Gratton
f0b5bc324c Implement xPortGetFreeHeapSize when using libc memory management 2015-06-16 14:20:52 +10:00
Angus Gratton
822533fd92 Interrupt support refactor
Write inline versions for SDK-based interrupt convenience functions.
2015-06-08 18:20:29 +10:00
Angus Gratton
0dbb6d31a5 Add IRAM attribute for IRAM loaded symbols, add to common FreeRTOS functions
Closes #7.

It'd be nice to change the linker script so .text is always linked to
IROM instead of needing to objcopy each compiled file. The sticking
point for this is libgcc & libhal, which have symbols in .text that need
to be loaded to IRAM.
2015-06-08 18:19:59 +10:00
Angus Gratton
e743d03a78 Preprocess all binary SDK symbols to add an sdk_ prefix
* This fixes the problem of axTLS symbols hmac_md5/hmac_sha1 having same
  name as symbols in libwpa (which have incompatible signatures)

* Also allows for easier identification and piece-by-piece removal of
  binary functions.

* Some libc symbols are not renamed, list is in lib/symbols_norename.txt
2015-06-02 15:08:35 +10:00
Angus Gratton
8e174aa518 Comment vPortEnterCritical/vPortExitCritical functions 2015-06-02 15:08:35 +10:00
Angus Gratton
3a5b46a09a Xtensa interrupt management function prototypes 2015-05-07 14:23:24 +10:00
Angus Gratton
6369b4cefa Clean up rest of port.c function 2015-05-07 14:23:24 +10:00
Angus Gratton
ee95fde5ec Change PendSV function signature to use enum 2015-05-07 14:23:24 +10:00
Angus Gratton
c3c531240e Remove pending sv posted flag, double-setting int bit doesn't matter 2015-05-07 14:23:24 +10:00
Angus Gratton
e95a93bdd9 Clean up PendSV/SV ISR 2015-05-07 14:23:24 +10:00
Angus Gratton
ddd88dbe59 Misc port.c cleanup, remove now-unused PortxxxInt_NoNest, comment misc bits of blob interface 2015-05-07 14:23:24 +10:00
Angus Gratton
de4855b86c First half of moving custom synchronisation primitive API to standard FreeRTOS 2015-05-07 14:23:24 +10:00
Angus Gratton
1ffbc303ff Working variant of esp_iot_rtos_sdk (files from commit ec75c85f9ef53) 2015-05-07 14:22:25 +10:00