/*
 * ll_testbed.cpp
 *
 *  Created on: Oct 28, 2019
 *      Author: abody
 */
#include <main.h>

#include <FreeRTOS.h>
#include <task.h>

#include <f4ll/console_handler.h>

#include <stdlib.h>
#include <string.h>

#include <app.h>

void app_main(void const *param)
{
    (void)param;
    app::init().main();
}

app::app()
    : m_con(
          f4ll::console_handler::init(
              USART2, DMA1, LL_DMA_STREAM_5, LL_DMA_STREAM_6, m_rx_buf_mem, sizeof(m_rx_buf_mem), m_tx_buf_mem, sizeof(m_tx_buf_mem),
              nullptr))
{
}

void app::main()
{
    m_con.print("-------------------------------------------\n");
    while (true) {
        m_con.print("Hello woooooooooooooooooooooooooooooooorld!\n");
        vTaskDelay(pdMS_TO_TICKS(500));
        LL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin);
    }
}