mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-24 23:09:26 -05:00
Touch: Default and active calibration API of sorts.
This commit is contained in:
parent
c022a72ef4
commit
5e5417b456
@ -74,6 +74,26 @@ ui::Point Calibration::translate(const DigitizerPoint& p) const {
|
||||
};
|
||||
}
|
||||
|
||||
static const Calibration _default_calibration {
|
||||
/* Values derived from one PortaPack H1 unit. */
|
||||
{ { { 256, 731 }, { 880, 432 }, { 568, 146 } } },
|
||||
{ { { 32, 48 }, { 208, 168 }, { 120, 288 } } }
|
||||
};
|
||||
|
||||
static Calibration _calibration = _default_calibration;
|
||||
|
||||
void set_calibration(const Calibration& value) {
|
||||
_calibration = value;
|
||||
}
|
||||
|
||||
const Calibration& calibration() {
|
||||
return _calibration;
|
||||
}
|
||||
|
||||
const Calibration& default_calibration() {
|
||||
return _default_calibration;
|
||||
}
|
||||
|
||||
void Manager::feed(const Frame& frame) {
|
||||
// touch_debounce.feed(touch_raw);
|
||||
const auto touch_raw = frame.touch;
|
||||
|
@ -149,6 +149,10 @@ private:
|
||||
int32_t f;
|
||||
};
|
||||
|
||||
void set_calibration(const Calibration& calibration);
|
||||
const Calibration& calibration();
|
||||
const Calibration& default_calibration();
|
||||
|
||||
template<size_t N>
|
||||
class Filter {
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user