Skip to content

Instantly share code, notes, and snippets.

@t27
Last active July 28, 2016 09:00
Show Gist options
  • Select an option

  • Save t27/ce9d41fdb2881f75208838b7693f9bf4 to your computer and use it in GitHub Desktop.

Select an option

Save t27/ce9d41fdb2881f75208838b7693f9bf4 to your computer and use it in GitHub Desktop.
TI Tiva launchpad measure function time
SysTickPeriodSet(80000000); // The period should be equal to the system clock time to ensure the systick values are in clock cycle units
SysTickEnable();
while(1) {
t1 = SysTickValueGet(); // clock cycles
a = pe -> getPosition();
t2 = SysTickValueGet(); // clock cycles
time = (t1 - t2); // difference measured in clock cycles
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment