Advertisement
Guest User

Untitled

a guest
Mar 21st, 2018
433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ARM 0.50 KB | None | 0 0
  1. .syntax unified
  2. .global main
  3. .type main, %function
  4.  
  5. main:
  6.   bl init
  7.   mov r5, 110 @ tick counter
  8.   mov r0, 0xb1e0 @-22000
  9.  
  10. loop:
  11.   @1. Calculate the next value in the sawtooth signal
  12.   cmp r5, 0
  13.   beq reset
  14.  
  15.   adds r0, 0x190
  16.  
  17.  
  18.   @2. bl to BSP_AUDIO_OUT_Play_Sample with that value in r0
  19.   sub r5, 1
  20.   bl BSP_AUDIO_OUT_Play_Sample
  21.   b loop
  22.  
  23.   reset:
  24.     mov r5, 110
  25.     mov r0, 0xb1e0
  26.   @3. go back to the top of the loop to do it again for the next value
  27.   b loop
  28.  
  29.   .size main, .-main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement