From: Thomas Pietrzak Date: Mon, 5 Nov 2018 14:38:16 +0000 (+0100) Subject: C X-Git-Url: https://git.thomaspietrzak.com/?a=commitdiff_plain;h=8a01bb8e9ef8fd3a49a22626c42b02fe2e6105bb;p=forcefader.git C --- diff --git a/capacitivetouch.h b/capacitivetouch.h index 6cd456d..0ca954e 100644 --- a/capacitivetouch.h +++ b/capacitivetouch.h @@ -1,11 +1,9 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif +#include + +BEGIN_DECL void init_capacitive_touch(); -#ifdef __cplusplus -} -#endif +END_DECL diff --git a/forcefader.cpp b/forcefader.cpp index 5fdf57f..2144cc9 100644 --- a/forcefader.cpp +++ b/forcefader.cpp @@ -22,7 +22,8 @@ pin_t faderpos_pin; timer_channel_t forceloop_timer = { .timer = timer_1, .channel = 1 }; -ForceModel *fm = NULL; +SpringModel sm(0.05, 5); +ForceModel *fm = &sm; void updateForce() { @@ -35,9 +36,9 @@ void updateForce() int main() { - //fm = new SpringModel(0.05, 5); + fm = new SpringModel(0.05, 5); //fm = new BowModel(0.01, 5); - fm = new PluckModel(0.05, 0.02, 5); + //fm = new PluckModel(0.05, 0.02, 5); faderpos_pin = make_pin(gpio_port_a, 0); //ADC1 CH0 diff --git a/forcemotor.h b/forcemotor.h index 7e03f65..67ae731 100644 --- a/forcemotor.h +++ b/forcemotor.h @@ -1,12 +1,10 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif +#include + +BEGIN_DECL void init_force_motor(); void set_force(float force); -#ifdef __cplusplus -} -#endif +END_DECL