Skip to content

Instantly share code, notes, and snippets.

@scottshuffler
Created January 26, 2016 20:10
Show Gist options
  • Save scottshuffler/2937792f88a06c5f4e9c to your computer and use it in GitHub Desktop.
Save scottshuffler/2937792f88a06c5f4e9c to your computer and use it in GitHub Desktop.
/*
* changeStack.c
*
* Created: 1/26/2016 2:00:48 PM
* Author : shuffleres
*/
#include <avr/io.h>
#include <avr/interrupt.h>
//#include "../../../../../toolchain/avr8/avr8-gnu-toolchain/avr/include/avr/io86r401.h"
uint8_t * changeStack(uint8_t *pNewStack);
int main(void) {
//Loop forever and ever and ever
while (1)
{
changeStack((uint8_t *)0x300);
changeStack((uint8_t *)0x190);
}
}
uint8_t * changeStack(uint8_t *pNewStack) {
//Interrupts off
cli();
uint8_t *retValue = 0;
if (*pNewStack > 0x200 && *pNewStack < 0xFFFF) {
uint16_t currSP = SP;
}
//Interrupts on
sei();
return retValue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment