auto-sync
This commit is contained in:
parent
40c6109873
commit
ed83729bcc
|
@ -102,7 +102,7 @@ static void waIcuPeriodCallback(WaveReader *reader) {
|
|||
static void setWaveModeSilent(int index, int mode) {
|
||||
WaveReader *reader = &readers[index];
|
||||
|
||||
setWaveReaderMode(&reader->hw, mode);
|
||||
startInputDriver(&reader->hw, mode);
|
||||
}
|
||||
|
||||
//static int getEventCounter(int index) {
|
||||
|
@ -130,7 +130,7 @@ static void initWave(const char *name, int index) {
|
|||
initWaveAnalyzerDriver(hw, brainPin);
|
||||
|
||||
print("wave%d input on %s%d\r\n", index, portname(reader->hw.port), reader->hw.pin);
|
||||
setWaveReaderMode(hw, mode);
|
||||
startInputDriver(hw, mode);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -158,9 +158,9 @@ void initWaveAnalyzerDriver(WaveReaderHw *hw, brain_pin_e brainPin) {
|
|||
}
|
||||
}
|
||||
|
||||
void setWaveReaderMode(WaveReaderHw *hw, bool mode) {
|
||||
hw->activeMode = mode;
|
||||
if (hw->activeMode) {
|
||||
void startInputDriver(WaveReaderHw *hw, bool isActiveHigh) {
|
||||
hw->isActiveHigh = isActiveHigh;
|
||||
if (hw->isActiveHigh) {
|
||||
wave_icucfg.mode = ICU_INPUT_ACTIVE_HIGH;
|
||||
} else {
|
||||
wave_icucfg.mode = ICU_INPUT_ACTIVE_LOW;
|
||||
|
|
|
@ -18,7 +18,7 @@ typedef struct {
|
|||
ICUDriver *driver;
|
||||
GPIO_TypeDef *port;
|
||||
int pin;
|
||||
int activeMode; // 0 for ICU_INPUT_ACTIVE_LOW, 1 for ICU_INPUT_ACTIVE_HIGH
|
||||
bool_t isActiveHigh; // false for ICU_INPUT_ACTIVE_LOW, true for ICU_INPUT_ACTIVE_HIGH
|
||||
volatile int started;
|
||||
|
||||
// todo: make this a template & reduce number of listeners?
|
||||
|
@ -33,7 +33,7 @@ extern "C"
|
|||
#endif /* __cplusplus */
|
||||
|
||||
void initWaveAnalyzerDriver(WaveReaderHw *hw, brain_pin_e brainPin);
|
||||
void setWaveReaderMode(WaveReaderHw *hw, bool mode);
|
||||
void startInputDriver(WaveReaderHw *hw, bool isActiveHigh);
|
||||
ICUDriver * getInputCaptureDriver(brain_pin_e hwPin);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Reference in New Issue