| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #include <stdio.h>
- #include "nuclei_sdk_soc.h"
- #include "cpuidh.h"
- #include "config.h"
- volatile SPDP theseSecs = 0.0;
- volatile SPDP startSecs = 0.0;
- volatile SPDP secs;
- SPDP time()
- {
- #if defined(CPU_SERIES) && CPU_SERIES == 100
- return (SPDP)__get_rv_time() / SOC_TIMER_FREQ;
- #else
- #if defined(__SYSTIMER_PRESENT) && (__SYSTIMER_PRESENT == 1)
- return (SPDP) SysTimer_GetLoadValue() / SOC_TIMER_FREQ;
- #else
- #error "This example require CPU System Timer feature"
- #endif
- #endif
- }
- void getSecs()
- {
- theseSecs = time() ;
- return;
- }
- void start_time()
- {
- getSecs();
- startSecs = theseSecs;
- return;
- }
- void end_time()
- {
- getSecs();
- secs = theseSecs - startSecs;
- return;
- }
|