- OSX
- STLink v2
- If you don't use homebrew, blindly type this into your terminal -
| git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" |
| # gcc-4.8 | |
| ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
| brew install openocd | |
| openocd --version # homebrew release of openocd supports most jtag adapters (ie stlink2) | |
| wget "https://launchpad.net/gcc-arm-embedded/4.8/4.8-2013-q4-major/+download/gcc-arm-none-eabi-4_8-2013q4-20131218-mac.tar.bz2" | |
| cd ~/Downloads | |
| tar -xzvf gcc-arm-none-eabi-4_8-2013q4-20131218-mac.tar.bz2 | |
| sudo cp -R gcc-arm-none-eabi-4_8-2013q4 /usr/local/ | |
| /usr/local/gcc-arm-none-eabi-4_8-2013q4/bin/arm-none-eabi-gcc --version # test |
| void SampleADC() { | |
| /* Wait till interrupt says samples are ready */ | |
| while (!AD1CON1bits.DONE); | |
| /* Assign buffer values to temp variables for processing */ | |
| tempPot = ADC1BUF0; | |
| /* Set threshold values to avoid fluctuating rounding errors */ | |
| int potThresh = 25; | |
| /* Volume levels */ | |
| const int dspVolume[] = { | |
| 0x00, 0x00, 0x00, 0x00, | |
| 0x00, 0x00, 0x00, 0x01, | |
| 0x00, 0x00, 0x00, 0x02, | |
| 0x00, 0x00, 0x00, 0x03, | |
| 0x00, 0x00, 0x00, 0x04, | |
| 0x00, 0x00, 0x00, 0x05, | |
| 0x00, 0x00, 0x00, 0x06, |