Hello, Community.
I am new to Visual Micro and very excited. I have developed my application using the standard IDE for the Due (currently 1.6).
I use a series of timers, where by I using the following code. This code was provided on the Arduino Forums and I have been very successful with it. It works just fine in the Arduino IDE.
// ISR flags
volatile int flagOne = 0;
void setup() {
startTimer(TC1, 0, TC3_IRQn, 100); //Initialize Timer
}
// Enable Timer
void startTimer(Tc *tc, uint32_t channel, IRQn_Type irq, uint32_t frequency) {
pmc_set_writeprotect(false);
pmc_enable_periph_clk((uint32_t)irq);
TC_Configure(tc, channel, TC_CMR_WAVE | TC_CMR_WAVSEL_UP_RC | TC_CMR_TCCLKS_TIMER_CLOCK4);
uint32_t rc = VARIANT_MCK / 128 / frequency; //128 because we selected TIMER_CLOCK4 above
TC_SetRA(tc, channel, rc / 2); //50% high, 50% low
TC_SetRC(tc, channel, rc);
TC_Start(tc, channel);
tc->TC_CHANNEL[channel].TC_IER = TC_IER_CPCS;
tc->TC_CHANNEL[channel].TC_IDR = ~TC_IER_CPCS;
NVIC_EnableIRQ(irq);
}
// TC3 Timer Interrupt Handler
void TC3_Handler()
{
TC_GetStatus(TC1, 0);
flagOne = 1;
}
As I then ported into Visual Micro, I am getting a red line error when I initialize the timer noting
"Error: expression preceding parentheses of apparent call must have (pointer-to-) function type"
I am reaching out to ask how to fix this, and possibly explain why porting this code into C# breaks it. I am VERY new to C#.
Thank you all.
dgelman