Keisuke Sehara
/
STM32_Whisking
fast-feedback virtual target task code on STM Nucleo
Diff: states.cpp
- Revision:
- 15:20f7f737c256
- Parent:
- 14:af3adf5d5ddf
- Child:
- 16:33c17c62840e
--- a/states.cpp Mon Jun 25 14:47:41 2018 +0000 +++ b/states.cpp Mon Jun 25 17:43:40 2018 +0000 @@ -54,14 +54,14 @@ events::lickhandler = &automaton::jump<Paired,WithResp>; // reward & visual feedback - visualOut.direct(true); + visualOut.start(); rewardOut.start(); stateTimeout.attach_us(&automaton::jump<Paired,NoResp>, ms_to_us(task.aud_dur_ms.value)); } void Paired::teardown() { - visualOut.direct(false); + visualOut.stop(); events::lickhandler = 0; } @@ -88,6 +88,8 @@ trial.markEndOfWait(); + trial.response &= ~TrialFlags::Cues; + // configure the interrupts events::lickhandler = &automaton::jump<Cued,Abort>; @@ -102,9 +104,12 @@ // start cue output switch(task.mode.value) { case Report: + visualOut.run(); + // no auditory cue + break; case Associate: visualOut.run(); - // fallthrough + // fallthrough (with auditory cue) case Motion: audioOut.write(1); buzzerTicker.attach_us(&tickBuzzer, trial.aud_ticker_cycle);