//----------------------------------------------------------------------------
///
/// \brief  Class for output pin
///
/// \date   20121107
/// \author Maximilian Seesslen <development.seesslen.net>
///
//----------------------------------------------------------------------------


//---Includes-----------------------------------------------------------------


///---General-------------------------

///---Own-----------------------------

#include <biwak/output_blink_modes.h>


//---Implementation-----------------------------------------------------------


#define BWK_S   125
#define BWK_SS  (BWK_S/3)
#define BWK_SSS  (BWK_S/8)
#define BWK_L   1000
#define BWK_SL  ( 1000 / 2 )
#define BWK_LL  ( BWK_L * 4 )
#define BWK_BLINK  300


int outputBlinkMode=0;
namespace BlinkModes
{

const SBlinkEntry _double[]  = { BWK_SS, BWK_S, BWK_SS, BWK_L, BLINK_CODE_LOOP };
const SBlinkEntry error[]  = { BWK_SSS, BWK_SS, BWK_SSS, BWK_SS, BLINK_CODE_LOOP };
const SBlinkEntry alarm[]  = { BWK_SSS, BWK_SL, BWK_SSS, BWK_SL, BLINK_CODE_LOOP };
const SBlinkEntry blink[]  = { BWK_BLINK, BWK_BLINK, BWK_BLINK, BWK_BLINK, BLINK_CODE_LOOP };
const SBlinkEntry triple[]  = { BWK_S, BWK_S, BWK_S, BWK_S, BWK_S, BWK_L, BLINK_CODE_LOOP };
const SBlinkEntry quad[]  = { BWK_S, BWK_S, BWK_S, BWK_S, BWK_S, BWK_S, BWK_S, BWK_L, BLINK_CODE_LOOP };
//constexpr SBlinkEntry COutput::blinkModeShot[]  = { BWK_SS, BWK_L, -2 };
const SBlinkEntry shot[]  = { BWK_SSS, BLINK_CODE_END };
const SBlinkEntry shotLoop[]  = { BWK_SSS, BWK_L, BLINK_CODE_LOOP };
const SBlinkEntry on[]  = { BLINK_CODE_ON };
const SBlinkEntry off[]  = { BLINK_CODE_OFF };
// const SBlinkEntry BlinkModes::fatal[]  = { BWK_BLINK, BWK_SS, BLINK_CODE_LOOP };
extern const SBlinkEntry fatal[] __attribute__ ((alias("_ZN10BlinkModes2onE")));

// Short Short Long Long;           ON      Off    On      Off   On     Off    On     Off
const SBlinkEntry bootLoader[]  = { BWK_SS, BWK_S, BWK_SS, BWK_S,BWK_S, BWK_S, BWK_S, BWK_L, BLINK_CODE_LOOP };
const SBlinkEntry bootLoaderReverse[]  = { BWK_S, BWK_S, BWK_S, BWK_S, BWK_SS, BWK_S, BWK_SS, BWK_L, BLINK_CODE_LOOP };

}


//---fin-----------------------------------------------------------------------
