-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
bkleiner
committed
Oct 29, 2023
1 parent
dbbe2aa
commit 0ae9a64
Showing
53 changed files
with
694 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,4 +73,5 @@ go.mod | |
go.sum | ||
|
||
/.pio | ||
__pycache__ | ||
__pycache__ | ||
flash.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "native", | ||
"build": { | ||
"core": "native", | ||
"cpu": "native", | ||
"extra_flags": "", | ||
"mcu": "native" | ||
}, | ||
"upload": { | ||
"maximum_ram_size": 104857600, | ||
"maximum_size": 10485760 | ||
}, | ||
"url": "", | ||
"vendor": "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
#pragma once | ||
|
||
#ifndef SIMULATOR | ||
#define USE_ADC | ||
#define USE_SPI | ||
#define USE_SERIAL | ||
#define USE_GYRO | ||
#define USE_SOFT_SERIAL | ||
#define USE_SDCARD | ||
#define USE_DATA_FLASH | ||
#define USE_BLACKBOX | ||
|
||
#define USE_VTX | ||
#define USE_DIGITAL_VTX | ||
#define USE_MAX7456 | ||
|
||
#define USE_MOTOR_DSHOT | ||
#define USE_MOTOR_PWM | ||
|
||
#define USE_RX_UNIFIED | ||
|
||
#ifndef AT32F4 | ||
#define USE_RX_SPI_FRSKY | ||
#define USE_RX_SPI_FLYSKY | ||
#define USE_RX_SPI_EXPRESS_LRS | ||
#endif | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
#include "driver/interrupt.h" | ||
|
||
void interrupt_enable(IRQn_Type irq, uint32_t prio) { | ||
#ifndef SIMULATOR | ||
NVIC_SetPriorityGrouping(3); | ||
NVIC_SetPriority(irq, prio); | ||
NVIC_EnableIRQ(irq); | ||
#endif | ||
} | ||
|
||
void interrupt_disable(IRQn_Type irq) { | ||
#ifndef SIMULATOR | ||
NVIC_DisableIRQ(irq); | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include "driver/fmc.h" | ||
|
||
#include <stdio.h> | ||
#include <string.h> | ||
|
||
#include "core/project.h" | ||
|
||
#define FILENAME "flash.bin" | ||
|
||
void fmc_lock() { | ||
} | ||
|
||
void fmc_unlock() { | ||
} | ||
|
||
void fmc_erase() { | ||
remove(FILENAME); | ||
} | ||
|
||
static FILE *open_file() { | ||
FILE *file = fopen(FILENAME, "rb+"); | ||
if (file == NULL) { | ||
file = fopen(FILENAME, "wb+"); | ||
} | ||
return file; | ||
} | ||
|
||
flash_word_t fmc_read(uint32_t addr) { | ||
FILE *file = open_file(); | ||
fseek(file, addr, SEEK_SET); | ||
flash_word_t value; | ||
fread(&value, sizeof(flash_word_t), 1, file); | ||
fclose(file); | ||
return value; | ||
} | ||
|
||
void fmc_read_buf(uint32_t addr, uint8_t *data, uint32_t size) { | ||
FILE *file = open_file(); | ||
fseek(file, addr, SEEK_SET); | ||
fread(data, size, 1, file); | ||
fclose(file); | ||
} | ||
|
||
void fmc_write(uint32_t addr, flash_word_t value) { | ||
FILE *file = open_file(); | ||
fseek(file, addr, SEEK_SET); | ||
fwrite(&value, sizeof(flash_word_t), 1, file); | ||
fclose(file); | ||
} | ||
|
||
void fmc_write_buf(uint32_t addr, uint8_t *data, uint32_t size) { | ||
FILE *file = open_file(); | ||
fseek(file, addr, SEEK_SET); | ||
fwrite(data, size, 1, file); | ||
fclose(file); | ||
} |
Oops, something went wrong.