Replace libmain:app_main.o with core/app_main.c
This commit is contained in:
parent
1eb0e58997
commit
ec8c3c134a
7 changed files with 805 additions and 0 deletions
30
core/include/esp/wdev_regs.h
Normal file
30
core/include/esp/wdev_regs.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
/* esp/wdev_regs.h
|
||||
*
|
||||
* ESP8266 register definitions for the "wdev" region (0x3FF2xxx)
|
||||
*
|
||||
* Not compatible with ESP SDK register access code.
|
||||
*/
|
||||
|
||||
#ifndef _ESP_WDEV_REGS_H
|
||||
#define _ESP_WDEV_REGS_H
|
||||
|
||||
#include "esp/types.h"
|
||||
#include "common_macros.h"
|
||||
|
||||
#define WDEV_BASE 0x3FF20000
|
||||
#define WDEV (*(struct WDEV_REGS *)(WDEV_BASE))
|
||||
|
||||
/* Note: This memory region is not currently well understood. Pretty much all
|
||||
* of the definitions here are from reverse-engineering the Espressif SDK code,
|
||||
* many are just educated guesses, and almost certainly some are misleading or
|
||||
* wrong. If you can improve on any of this, please contribute!
|
||||
*/
|
||||
|
||||
struct WDEV_REGS {
|
||||
uint32_t volatile _unknown[768]; // 0x0000 - 0x0bfc
|
||||
uint32_t volatile SYS_TIME; // 0x0c00
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
_Static_assert(sizeof(struct WDEV_REGS) == 0xc04, "WDEV_REGS is the wrong size");
|
||||
|
||||
#endif /* _ESP_WDEV_REGS_H */
|
|
@ -31,6 +31,17 @@ struct WDT_REGS {
|
|||
|
||||
_Static_assert(sizeof(struct WDT_REGS) == 0x18, "WDT_REGS is the wrong size");
|
||||
|
||||
/* Details for CTRL register */
|
||||
|
||||
/* Note: these are currently just guesses based on interpretation of the startup code */
|
||||
|
||||
#define WDT_CTRL_ENABLE BIT(0)
|
||||
#define WDT_CTRL_FIELD0_M 0x00000003
|
||||
#define WDT_CTRL_FIELD0_S 1
|
||||
#define WDT_CTRL_FLAG3 BIT(3)
|
||||
#define WDT_CTRL_FLAG4 BIT(4)
|
||||
#define WDT_CTRL_FLAG5 BIT(5)
|
||||
|
||||
/* Writing WDT_FEED_MAGIC to WDT.FEED register "feeds the dog" and holds off
|
||||
* triggering for another cycle (unconfirmed) */
|
||||
#define WDT_FEED_MAGIC 0x73
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue