Files
GP2040-CE/headers/system.h
Luke A 9e3d7a6059 Add board flash 0x9f SPI command to web config (#1075)
* [ImgBot] Optimize images

*Total -- 11,807.83kb -> 10,597.19kb (10.25%)

/configs/MavercadeRev2/assets/Rev2_config_pic.jpg -- 1,148.71kb -> 1,001.39kb (12.83%)
/configs/MavercadeRev2/assets/Rev2_thumbnail.png -- 4,501.00kb -> 3,984.05kb (11.49%)
/configs/ZeroRhythm/Assets/ZeroThythm 2.jpg -- 2,954.52kb -> 2,669.00kb (9.66%)
/configs/ZeroRhythm/Assets/ZeroRhythm 1.jpg -- 2,687.40kb -> 2,428.72kb (9.63%)
/configs/MavercadeRev1/assets/Rev1_config_pic.png -- 516.19kb -> 514.02kb (0.42%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>

* Added actual board flash info to homepage

* Missing define

* Bump up the TX/RX memory space even more

* Last attempt at correctness

* Updated system flash size to be a static int32_t only called once at start of web

---------

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com>
2024-09-16 22:08:08 -04:00

35 lines
1.2 KiB
C++

#ifndef SYSTEM_H_
#define SYSTEM_H_
#include <cstdint>
namespace System {
// Returns the size of on-board flash memory reserved by the config
uint32_t getTotalFlash();
// Returns the amount of on-board flash memory used by the firmware in bytes
uint32_t getUsedFlash();
// Returns the amount of physical flash memory on the board
uint32_t getPhysicalFlash();
// Returns the amount of memory used for static allocations in bytes
uint32_t getStaticAllocs();
// Returns the total size of heap memory in bytes
uint32_t getTotalHeap();
// Returns the about of heap memory currently allocated in bytes
uint32_t getUsedHeap();
enum class BootMode : uint32_t {
DEFAULT = 0,
GAMEPAD = 0x43d566cd,
WEBCONFIG = 0xe77784a5,
USB = 0xf737e4e1,
};
// Reboots the device and places the supplied BootMode value in a watchdog scratch register
// This value can be retrieved after reboot by client code, which can then take the required actions
void reboot(BootMode bootMode);
// Retrieves the BootMode value from the watchdog scratch register and resets its value to BootMode::DEFAULT
BootMode takeBootMode();
}
#endif