2024-02-06 15:50:50 +01:00
|
|
|
#include <stdio.h>
|
2024-02-07 09:32:11 +01:00
|
|
|
#include <pico/stdlib.h>
|
2024-02-06 15:50:50 +01:00
|
|
|
|
2024-02-06 22:11:58 +01:00
|
|
|
#include "settings.h"
|
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
2024-02-07 11:15:41 +01:00
|
|
|
const uint LED_PIN = PICO_DEFAULT_LED_PIN;
|
2024-02-06 16:16:18 +01:00
|
|
|
}
|
2024-02-06 15:50:50 +01:00
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
stdio_init_all();
|
2024-02-06 22:11:58 +01:00
|
|
|
sleep_ms(1000);
|
2024-02-07 11:15:41 +01:00
|
|
|
gpio_init(LED_PIN);
|
|
|
|
gpio_set_dir(LED_PIN, GPIO_OUT);
|
|
|
|
gpio_put(LED_PIN, 0);
|
2024-02-06 15:50:50 +01:00
|
|
|
|
2024-02-07 09:32:11 +01:00
|
|
|
Settings settings;
|
|
|
|
settings.mode = Mode::IAMBIC_A;
|
2024-02-07 11:15:41 +01:00
|
|
|
settings.wpm = 25;
|
|
|
|
|
|
|
|
//store_settings(settings);
|
|
|
|
|
|
|
|
Settings newSettings{read_settings()};
|
|
|
|
|
2024-02-07 09:34:03 +01:00
|
|
|
printf("Iambic mode (loaded): %d\n", static_cast<int>(newSettings.mode));
|
2024-02-07 11:15:41 +01:00
|
|
|
printf("WPM (loaded): %d\n", newSettings.wpm);
|
|
|
|
|
|
|
|
if (settings.mode == Mode::IAMBIC_A && settings.wpm == 25)
|
|
|
|
{
|
|
|
|
gpio_put(LED_PIN, 1);
|
|
|
|
}
|
2024-02-07 09:32:11 +01:00
|
|
|
|
2024-02-07 11:15:41 +01:00
|
|
|
while (true)
|
|
|
|
{
|
2024-02-07 09:32:11 +01:00
|
|
|
sleep_ms(1000);
|
|
|
|
}
|
|
|
|
|
2024-02-06 15:50:50 +01:00
|
|
|
return 0;
|
|
|
|
}
|