File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
src/drivers/hardware_specific Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -310,17 +310,18 @@ void writeSAMDDutyCycle(int chaninfo, float dc) {
310
310
uint8_t chan = GetTCChannelNumber (chaninfo);
311
311
if (tccn<TCC_INST_NUM) {
312
312
Tcc* tcc = (Tcc*)GetTC (chaninfo);
313
- // set via CC
314
- // tcc->CC[chan].reg = (uint32_t)((SIMPLEFOC_SAMD_PWM_RESOLUTION-1) * dc);
315
- // uint32_t chanbit = 0x1<<(TCC_SYNCBUSY_CC0_Pos+chan);
316
- // while ( (tcc->SYNCBUSY.reg & chanbit) > 0 );
313
+ // set via CC
314
+ // tcc->CC[chan].reg = (uint32_t)((SIMPLEFOC_SAMD_PWM_RESOLUTION-1) * dc);
315
+ // uint32_t chanbit = 0x1<<(TCC_SYNCBUSY_CC0_Pos+chan);
316
+ // while ( (tcc->SYNCBUSY.reg & chanbit) > 0 );
317
317
// set via CCB
318
+ while ( (tcc->SYNCBUSY .vec .CC & (0x1 <<chan)) > 0 );
318
319
tcc->CCB [chan].reg = (uint32_t )((SIMPLEFOC_SAMD_PWM_RESOLUTION-1 ) * dc);
319
- while ( (tcc->SYNCBUSY .vec .CCB & (0x1 <<chan)) > 0 );
320
- tcc->STATUS .vec .CCBV |= (0x1 <<chan);
321
- while ( tcc->SYNCBUSY .bit .STATUS > 0 );
322
- tcc->CTRLBSET .reg |= TCC_CTRLBSET_CMD (TCC_CTRLBSET_CMD_UPDATE_Val);
323
- while ( tcc->SYNCBUSY .bit .CTRLB > 0 );
320
+ // while ( (tcc->SYNCBUSY.vec.CCB & (0x1<<chan)) > 0 );
321
+ // tcc->STATUS.vec.CCBV |= (0x1<<chan);
322
+ // while ( tcc->SYNCBUSY.bit.STATUS > 0 );
323
+ // tcc->CTRLBSET.reg |= TCC_CTRLBSET_CMD(TCC_CTRLBSET_CMD_UPDATE_Val);
324
+ // while ( tcc->SYNCBUSY.bit.CTRLB > 0 );
324
325
}
325
326
else {
326
327
Tc* tc = (Tc*)GetTC (chaninfo);
You can’t perform that action at this time.
0 commit comments