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


#include "UserLib.h"


//
// The init function
//
void eCxx_user_init()
{
#ifdef __AVR_ARCH__
    // Application configuration for AVR
    const App::Config config(
        true,                     // Enable PWM
        App::Config::WDTO::_250mS // Watchdog timeout 250 mS
    );
#endif

#ifdef __XTENSA__
    // Application configuration for NodeMCU
    const App::Config config(
        PGM_STR("<ssid>"   ),                               // Access point SSID
        PGM_STR("<password"),                               // Access point password
        1,                                                  // Access point channel
        eCxx::makeArray<eCxx::uint8_t, 0, 0, 0, 0, 0, 0>(), // Access point MAC address (all zeros mean using the default address)
        PGM_STR("<ota>"    ),                               // OTA programming password
        PGM_STR("hostname" )                                // Hostname
    );
#endif

    // Initialize application
    App::initialize(config);
}
