Skip to content

Commit 5c02ed4

Browse files
ABOSTMfpistm
authored andcommitted
HardwareTimer_OutputInput_test: complement with update interrupt only
1 parent d24760e commit 5c02ed4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

examples/NonReg/HardwareTimer/HardwareTimer_OutputInput_test/HardwareTimer_OutputInput_test.ino

+17
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,23 @@ void loop()
375375
/********* Output test ***/
376376
test_step++;
377377

378+
MyTim_output->setMode(Output1_channel, TIMER_OUTPUT_COMPARE, NC);
379+
MyTim_output->setOverflow((1000000 / OUTPUT_FREQUENCY), MICROSEC_FORMAT);
380+
MyTim_output->attachInterrupt(output_Update_IT_callback);
381+
MyTim_output->resume();
382+
reset_interrupt_count();
383+
Verify_output(1, 0, 0);
384+
Verify_output(2, 0, 0);
385+
Verify_output_interrupts(EXPECTED_INTERRUPT_COUNT, 0, 0);
386+
test_step++;
387+
388+
MyTim_output->detachInterrupt();
389+
reset_interrupt_count();
390+
Verify_output(1, 0, 0);
391+
Verify_output(2, 0, 0);
392+
Verify_output_interrupts(0, 0, 0);
393+
test_step++;
394+
378395
MyTim_output->setMode(Output1_channel, TIMER_OUTPUT_COMPARE_PWM1, TIM1_CH1N_PIN);
379396
MyTim_output->setOverflow((1000000 / OUTPUT_FREQUENCY), MICROSEC_FORMAT);
380397
MyTim_output->setCaptureCompare(Output1_channel, OUTPUT_DUTY1, PERCENT_COMPARE_FORMAT);

0 commit comments

Comments
 (0)