Appendixa complete example of profiling, Appendix a, “complete example of profiling,” pro, Appendix a – Motorola ONCE SC140 User Manual

Page 23: Complete example of profiling

Advertising
background image

Complete Example of Profiling

A-1

Appendix A

Complete Example of Profiling

A complete example of profiling using the Enhanced OnCE stopwatch timer in the SC140 platform is
presented in this appendix.

Code A-1. EOnCE_stopwatch.h

typedef enum { EONCE_SECOND, EONCE_MILLISECOND, EONCE_MICROSECOND } tunit;

#define READ_IOREG(reg,val) val = *((volatile long *)reg)
#define WRITE_IOREG(reg,val) *((volatile long *)reg) = val
#define MAX_32_BIT 0xffffffff

void EOnCE_stopwatch_timer_init();
void EOnCE_stopwatch_timer_start();
void EOnCE_stopwatch_timer_stop(unsigned long *clock_ext, unsigned long *clock_val);
void EOnCE_LED_init();
void EOnCE_LED_off();
unsigned long Convert_clock2time(unsigned long clock_ext, unsigned long clock_val, short option);

Advertising