Advertisement
Guest User

Bad ARM

a guest
Mar 9th, 2022
44
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int va = 0;
  2. static void dbg_task(void)
  3. {
  4.     va = __aeabi_idivmod(FREQ, 1000000);
  5. }
  6.  
  7. void testfn(void)
  8. {
  9.     uint16_t delay = 1;
  10.     bool last = false;
  11.     cpu_boost(last);
  12.     tick_add_task(dbg_task);
  13.  
  14.     for(int i = 0; i <  1000; i++)
  15.     {
  16.         while ( ++delay > 0) {
  17.             if ((delay % 100) == 0)
  18.             {
  19.                 cpu_boost(last);
  20.                 last = !last;
  21.             }
  22.  
  23.         }
  24.         splashf(0, "%ld / %d = %d", FREQ, 1000000, va);
  25.     }
  26.     tick_remove_task(dbg_task);
  27. }
  28. ------------------------------
Advertisement
RAW Paste Data Copied
Advertisement