REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches
plugin.cpp File Reference
#include <Arduino.h>
#include <cstring>
#include "imxrt.h"
#include "teensy_startup.h"
#include "utils/etl_base64.h"
#include "plugin/plugin.h"
#include "utils/align.h"
#include "utils/hashflash.h"
#include "utils/logging.h"
Include dependency graph for plugin.cpp:

Go to the source code of this file.

Macros

#define M(name)
 
#define CALL(type, sig)
 
#define return_err(code, msg)
 

Functions

void prepare_mpu ()
 At the time being, we completely disable the Memory Protection Unit in order to enable our plugin system.
 
FLASHMEM std::string shortened_hexdump (uint8_t *mem, size_t size)
 
FLASHMEM void dispatch (uint8_t *callee, Function::Returns ret_type, JsonVariant ret)
 

Variables

static constexpr int the_memsize = 1024
 
uint8_t GlobalPluginLoader_Storage [the_memsize]
 

Macro Definition Documentation

◆ CALL

#define CALL ( type,
sig )
Value:
case Function::Returns::type: { \
auto entry = (Function::sig *)callee; \
ret.set(entry()); \
break; \
}

Referenced by dispatch().

◆ M

#define M ( name)
Value:
if (o["returns"] == #name) \
f.ret_type = Function::Returns::name

Referenced by loader::convertFromJson().

◆ return_err

#define return_err ( code,
msg )
Value:
{ \
msg_out["error"] = msg; \
return code; \
}
Definition carrier.h:12

Definition at line 143 of file plugin.cpp.

Function Documentation

◆ dispatch()

FLASHMEM void dispatch ( uint8_t * callee,
Function::Returns ret_type,
JsonVariant ret )

◆ prepare_mpu()

void prepare_mpu ( )

At the time being, we completely disable the Memory Protection Unit in order to enable our plugin system.

The MPU can harden the memory security against exploits, so a more fine-grained approach is favorable in the future.

Definition at line 30 of file plugin.cpp.

Referenced by loader::GlobalPluginLoader::GlobalPluginLoader().

◆ shortened_hexdump()

FLASHMEM std::string shortened_hexdump ( uint8_t * mem,
size_t size )

Definition at line 88 of file plugin.cpp.

Referenced by loader::convertToJson().

Variable Documentation

◆ GlobalPluginLoader_Storage

uint8_t GlobalPluginLoader_Storage[the_memsize]

Definition at line 22 of file plugin.cpp.

Referenced by loader::GlobalPluginLoader::GlobalPluginLoader().

◆ the_memsize

int the_memsize = 1024
staticconstexpr

Definition at line 21 of file plugin.cpp.

Referenced by loader::GlobalPluginLoader::GlobalPluginLoader().