Add conditional compilation for open_esplib code

This commit is contained in:
Alex Stewart 2016-03-22 17:43:07 -07:00 committed by Angus Gratton
parent 4d6fa0ccfa
commit 3e5af479bc
8 changed files with 78 additions and 7 deletions

View file

@ -1,3 +1,7 @@
#include "open_esplibs.h"
#if OPEN_LIBMAIN_MISC
// The contents of this file are only built if OPEN_LIBMAIN_MISC is set to true
#include "espressif/esp_misc.h"
#include "esp/gpio_regs.h"
#include "esp/rtc_regs.h"
@ -57,3 +61,5 @@ uint8_t sdk_rtc_get_reset_reason(void) {
RTC.RESET_REASON0 &= ~RTC_RESET_REASON0_SOMETHING;
return reason;
}
#endif /* OPEN_LIBMAIN_MISC */

View file

@ -1,3 +1,7 @@
#include "open_esplibs.h"
#if OPEN_LIBMAIN_OS_CPU_A
// The contents of this file are only built if OPEN_LIBMAIN_OS_CPU_A is set to true
#include "esp/types.h"
#include "FreeRTOS.h"
#include "task.h"
@ -119,3 +123,4 @@ void IRAM sdk__xt_clear_ints(uint32_t mask) {
WSR(mask, intclear);
}
#endif /* OPEN_LIBMAIN_OS_CPU_A */

View file

@ -1,3 +1,7 @@
#include "open_esplibs.h"
#if OPEN_LIBMAIN_SPI_FLASH
// The contents of this file are only built if OPEN_LIBMAIN_SPI_FLASH is set to true
#include "FreeRTOS.h"
#include "common_macros.h"
#include "esp/spi_regs.h"
@ -181,3 +185,4 @@ sdk_SpiFlashOpResult IRAM sdk_spi_flash_read(uint32_t src_addr, uint32_t *des_ad
return result;
}
#endif /* OPEN_LIBMAIN_SPI_FLASH */

View file

@ -1,3 +1,7 @@
#include "open_esplibs.h"
#if OPEN_LIBMAIN_TIMERS
// The contents of this file are only built if OPEN_LIBMAIN_TIMERS is set to true
#include "etstimer.h"
#include "stdio.h"
@ -88,3 +92,4 @@ void sdk_os_timer_disarm(ETSTimer *ptimer) {
}
}
#endif /* OPEN_LIBMAIN_TIMERS */

View file

@ -1,3 +1,7 @@
#include "open_esplibs.h"
#if OPEN_LIBMAIN_UART
// The contents of this file are only built if OPEN_LIBMAIN_UART is set to true
#include "espressif/sdk_private.h"
#include "esp/uart_regs.h"
@ -15,3 +19,4 @@ void sdk_Uart_Init(void) {
/* No-Op */
}
#endif /* OPEN_LIBMAIN_UART */

View file

@ -1,3 +1,7 @@
#include "open_esplibs.h"
#if OPEN_LIBMAIN_XTENSA_CONTEXT
// The contents of this file are only built if OPEN_LIBMAIN_XTENSA_CONTEXT is set to true
.section .iram1.text, "ax", @progbits
.balign 4
@ -39,3 +43,4 @@ sdk__xt_context_restore:
l32i a13, sp, 64
ret
#endif /* OPEN_LIBMAIN_XTENSA_CONTEXT */