Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
/*****************************************************************************
Encoder.cpp
Copyright (c) 2020 Raphael DINGE
*Tab=3***********************************************************************/
/*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
#include "erb/Encoder.h"
namespace erb
{
/*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
/*
==============================================================================
Name : ctor
==============================================================================
*/
Encoder::Encoder (const uint8_t & data_0, const uint8_t & data_1)
: _inc (data_0)
, _dec (data_1)
{
}
/*
==============================================================================
Name : operator int
==============================================================================
*/
Encoder::operator int () const
{
int ret = 0;
if (_inc.pressed ())
{
ret += 1;
}
if (_dec.pressed ())
{
ret -= 1;
}
return ret;
}
/*\\\ INTERNAL \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
/*
==============================================================================
Name : impl_preprocess
==============================================================================
*/
void Encoder::impl_preprocess ()
{
_inc.impl_preprocess ();
_dec.impl_preprocess ();
}
/*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
/*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
} // namespace erb
/*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
de542a4b1This file is pinned to the selected release. Download the original to open it in your design tool.