/*
 * Copyright (C) 2020-2021 Aloysius Indrayanto
 *
 * This file is part of the eCxx library, see LICENSE file for the license details.
 */


#include <eCxx/eCxx_MemoryCard.h>

#include "NodeMCU_Common.h"


//
// Include common source code for RawMemoryCard test application
//
#include "../CommonCode/RawMemoryCard_Common.h"


//
// The init function
//
void eCxx_user_init()
{
    // Initialize application
    initBasicNodeMCUApp(true);

    // Enable the 74LVC541 buffers on the eCxx NodeMCU development board because
    // the SPI pins are buffered
    App::setPinMode  ( eCxx::NodeMCU::D0, eCxx::Application::PinMode::Output ); // GPIO16
    App::digitalWrite( eCxx::NodeMCU::D0, false                              ); // The buffers are active low

    // Initialize and test raw-mode memory card reader and writer
    eCxx_user_init_rmcInitAndTest();
}


//
// The task function
//
void eCxx_user_task()
{
    // Process event
    eCxx::Application::processEvent();
}
