Add FatFS hello world. Will be removed but shows, that device is functional

This commit is contained in:
2020-02-25 20:05:48 +01:00
parent a39fe09de4
commit a338831d69
12 changed files with 24422 additions and 0 deletions

View File

@@ -39,6 +39,7 @@
#include <stm-periph/uart.h>
#include <reflow-controller/shell-uart-config.h>
#include <helper-macros/helper-macros.h>
#include <fatfs/ff.h>
static void setup_nvic_priorities()
{
@@ -101,8 +102,12 @@ static inline void setup_sell_uart(struct stm_uart *uart)
NVIC_EnableIRQ(DMA2_Stream7_IRQn);
}
const char *oven_controller_hello_world = "Hello world :)\n";
int main()
{
FATFS fs;
FIL test_file;
const char *uart_input;
size_t uart_input_len;
shellmatta_handle_t shell_handle;
@@ -123,6 +128,13 @@ int main()
shell_handle = shell_init(write_shell_callback);
if (f_mount(&fs, "0:/", 1) == FR_OK) {
f_open(&test_file, "hello-world.txt", FA_OPEN_APPEND | FA_WRITE);
f_write(&test_file, oven_controller_hello_world, strlen(oven_controller_hello_world), NULL);
f_close(&test_file);
}
while (1) {
pt1000_value_status = adc_pt1000_get_current_resistance(&pt1000_value);
rot = rotary_encoder_get_abs_val();
@@ -133,6 +145,11 @@ int main()
}
void sdio_wait_ms(uint32_t ms)
{
systick_wait_ms(ms);
}
void DMA2_Stream7_IRQHandler()
{
uint32_t hisr = DMA2->HISR;