summaryrefslogtreecommitdiffstats
path: root/firmware/main.c
diff options
context:
space:
mode:
authorJenna Fox <a@creativepony.com>2012-09-26 13:03:53 +1000
committerJenna Fox <a@creativepony.com>2012-09-26 13:03:53 +1000
commit8a578076dbb542a0e1218e93a2ae1cfa735ef964 (patch)
tree36f00cac6d5a18b95d4f53379dfc62b8c629a307 /firmware/main.c
parentde19ff10edcb97d9b3b453516bd5975f62db449b (diff)
downloadmicronucleus-8a578076dbb542a0e1218e93a2ae1cfa735ef964.tar.gz
micronucleus-8a578076dbb542a0e1218e93a2ae1cfa735ef964.tar.bz2
micronucleus-8a578076dbb542a0e1218e93a2ae1cfa735ef964.zip
Adding more comments mostly - no functional changes
Diffstat (limited to 'firmware/main.c')
-rw-r--r--firmware/main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/firmware/main.c b/firmware/main.c
index 7476254..2f9444f 100644
--- a/firmware/main.c
+++ b/firmware/main.c
@@ -163,11 +163,14 @@ static void writeFlashPage(void) {
// write a word in to the page buffer, doing interrupt table modifications where they're required
static void writeWordToPageBuffer(uint16_t data) {
- // first two interrupt vectors get replaced with a jump to the bootloader vector table
+ // first two interrupt vectors get replaced with a jump to the bootloader's vector table
if (currentAddress == (RESET_VECTOR_OFFSET * 2) || currentAddress == (USBPLUS_VECTOR_OFFSET * 2)) {
data = 0xC000 + (BOOTLOADER_ADDRESS/2) - 1;
}
-
+
+ // at end of page just before bootloader, write in tinyVector table
+ // see http://embedded-creations.com/projects/attiny85-usb-bootloader-overview/avr-jtag-programmer/
+ // for info on how the tiny vector table works
if (currentAddress == BOOTLOADER_ADDRESS - TINYVECTOR_RESET_OFFSET) {
data = vectorTemp[0] + ((FLASHEND + 1) - BOOTLOADER_ADDRESS)/2 + 2 + RESET_VECTOR_OFFSET;
}