38 lines
791 B
C++
38 lines
791 B
C++
/*
|
|
* Stairs
|
|
* Copyright 2017 (c) Mark van Renswoude
|
|
*
|
|
* https://git.x2software.net/pub/Stairs
|
|
*/
|
|
#ifndef __settingssteps
|
|
#define __settingssteps
|
|
|
|
#include <stdint.h>
|
|
|
|
#define MaxStepCount 16
|
|
|
|
|
|
class StepsSettings
|
|
{
|
|
private:
|
|
uint8_t mCount = 16;
|
|
bool mUseCurve = true;
|
|
uint16_t mCurveShift[MaxStepCount];
|
|
|
|
public:
|
|
StepsSettings();
|
|
|
|
void read();
|
|
void write();
|
|
|
|
uint8_t count() { return mCount; }
|
|
void count(uint8_t value) { mCount = value; }
|
|
|
|
bool useCurve() { return mUseCurve; }
|
|
void useCurve(bool value) { mUseCurve = value; }
|
|
|
|
uint16_t curveShift(uint8_t step) { return step < MaxStepCount ? mCurveShift[step] : 0; }
|
|
uint16_t curveShift(uint8_t step, uint16_t value) { if (step < MaxStepCount) mCurveShift[step] = value; }
|
|
};
|
|
|
|
#endif |