Other Parts Discussed in Thread: DRV8301
Hi,
I've seen the partial of source code in the example project. I'm not very sure one thing.... When the program goes o (*Alpha_State_Ptr)() which will jump to many sub-routine, will the main routine wait for all of sub-routines completed and just go to run #ifdef DRV8301 ?? Thanks !!
for(;;) //infinite loop
{
BackTicker++;
// State machine entry & exit point
//===========================================================
(*Alpha_State_Ptr)(); // jump to an Alpha state (A0,B0,...)
//===========================================================
#ifdef DRV8301
//read the status registers from the DRV8301
if(read_drv_status)
{
DRV8301_stat_reg1.all = DRV8301_SPI_Read(&SpibRegs,STAT_REG_1_ADDR);
DRV8301_stat_reg2.all = DRV8301_SPI_Read(&SpibRegs,STAT_REG_2_ADDR);
read_drv_status = 0;
}
#endif
}