More missing files.

This commit is contained in:
David Given
2018-10-20 16:25:19 +02:00
parent 41f56c4ef5
commit 30f716d1b5
2 changed files with 49 additions and 0 deletions

24
lib/fluxmap.cc Normal file
View File

@@ -0,0 +1,24 @@
#include "globals.h"
#include "fluxmap.h"
#include "protocol.h"
Fluxmap& Fluxmap::appendIntervals(std::vector<uint8_t>& intervals)
{
return appendIntervals(&_intervals[0], _intervals.size());
}
Fluxmap& Fluxmap::appendIntervals(const uint8_t* ptr, size_t len)
{
_intervals.reserve(_intervals.size() + len);
while (len--)
{
uint8_t interval = *ptr++;
_ticks += interval ? interval : 0x100;
_intervals.push_back(interval);
}
_duration = _ticks * NS_PER_TICK;
return *this;
}