You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
719 B
28 lines
719 B
#include "pru_time.h"
|
|
|
|
near uint32_t coreTimeTicks = 0;
|
|
near uint32_t coreTempTicks = 0;
|
|
|
|
uint32_t getTimeTicks( void ){
|
|
coreTempTicks = CT_CTRL.CYCLE;
|
|
return coreTimeTicks;
|
|
};
|
|
|
|
void resetTimeTicks( void ){
|
|
//CT_CTRL.CONTROL_bit.CTR_EN = 0;
|
|
//CT_CTRL.CYCLE = 6; // Not nul because of operational delay
|
|
//CT_CTRL.CONTROL_bit.CTR_EN = 1;
|
|
CT_CTRL.CTRL_bit.COUNTER_ENABLE = 0;
|
|
CT_CTRL.CYCLE = 6; // Not nul because of operational delay
|
|
CT_CTRL.CTRL_bit.COUNTER_ENABLE = 1;
|
|
coreTempTicks = CT_CTRL.CYCLE;
|
|
coreTimeTicks = 0;
|
|
};
|
|
|
|
void waitTimeTicks( uint32_t Ticks ){
|
|
near uint32_t TT;
|
|
//TT = CT_CTRL.CYCLE + Ticks;
|
|
//while( CT_CTRL.CYCLE < TT );
|
|
TT = 0;
|
|
while( TT < Ticks )TT++;
|
|
};
|