42 #include <px4_platform_common/px4_config.h> 54 #define MAX_BLOCKS 1000 61 #define VALUE(i) ((i*7) ^ 0xDEADBEEF) 72 for (uint32_t i = 0; i <
sizeof(blocks[
nblocks]->
v) /
sizeof(uint32_t); i++) {
79 printf(
"Allocated %u blocks\n",
nblocks);
84 for (uint32_t n = 0; n <
nblocks; n++) {
85 for (uint32_t i = 0; i <
sizeof(blocks[
nblocks]->
v) /
sizeof(uint32_t); i++) {
86 assert(blocks[n]->
v[i] ==
VALUE(i));
95 printf(
"Starting reflector\n");
101 ssize_t n =
read(0, buf,
sizeof(buf));
113 if (total > 1024000) {
static void allocate_blocks(void)
static void read(bootloader_app_shared_t *pshared)
static struct block * blocks[MAX_BLOCKS]
Simple error/warning functions, heavily inspired by the BSD functions of the same names...
__EXPORT int reflect_main(int argc, char *argv[])
static void write(bootloader_app_shared_t *pshared)
static void check_blocks(void)