Feature #757
Von Maximilian Seesslen vor 1 Tag aktualisiert
<pre><code class="cpp">
constexpr unsigned int lpdiv100( unsigned int x )
{
// Valid till 102400
return( ( ( x + 1 ) * 0xA3D7 ) >> 22 );
};
static_assert( lpdiv100(2099) == 20 );
static_assert( lpdiv100(2100) == 21 );
</code></pre>
The RTC Alarm has to be checked for the next (!) alarm.
constexpr unsigned int lpdiv100( unsigned int x )
{
// Valid till 102400
return( ( ( x + 1 ) * 0xA3D7 ) >> 22 );
};
static_assert( lpdiv100(2099) == 20 );
static_assert( lpdiv100(2100) == 21 );
</code></pre>
The RTC Alarm has to be checked for the next (!) alarm.