minor fixes in test_dospm itself.
test_dospm (which uses only the "high level" calls to read and
write pages) now works the same (I think) on both traditional
AVR and new mega0/xTiny chips.
add a test_nvmctrl.ino sketch in examples that allows one to poke at it.
(the test sketch needs additional work; most of optiboo_x.h is commented out, and it should be merged with optiboot.x)
Remove mega0 targets from the Makefile.extras, where they slipped in accidentallly. They never worked, and caused confusing since a "make atmega4809" would generate compile errors instead of "unknown target" errors.
Fix comments so that TIMEOUT is in seconds (compatible with optiboot_x)
Check for illegal timeouts on older chips (4s and 8s are impossible on ATmega8) by checking whether the extra bit is defined in the ioxxx.h file.
Update the .hex and .lst files (binaries don't change from this edit, but I never updated them last time.)
Also, it's a bad sign if your own code lokos confusing after only a month, so use better names for the PMUX-related values (MYPMUX_REG instead of MYPMUX, and MYUART_PMUX_VAL instead of MYUART_PMUX) Also, use the enums for 4809/etc.
Dynamically read chip signature, which should permit quie a bit of sharing of single binaries between multiple chips (as long as LED and UARTTX are the same.)
Now that we have a slower clockrate, the LED delay only needs 16bits.
Update Makefile help text, and the options saved in flash with BIGBOOT.
Document fuse requirements/issues.
For example "make -f Makefile.mega0 drazzy3217"
Add LED_INVERT option to makefile option parser.
Clean up RSTPIN for chips with only two values.
Shave off a few bytes by writing PMUX instead of ORing, and using the default clock speed (20MHz/6) instead of turning off the divider. (not that we need to save space yet.)
Implement something for the "do_spm" function. This just writes "cmd" to NVMCTREL.CTRLA; I'm not sure whether an application can write to the page buffer to make that sufficient. Needs testing.
ATtiny412 working.
add RSTPIN option to control the (internal) FUSE values.
More source code "prettyfication"
Observation: in MPLABX, if you set the project linker memory options
for ".postapp=0x200", MPLAB will happily double those values before
actually passing them to the linker, because you must have meant WORDS, right?
Observation 2: The ATmega4809 definition in avrdude.conf is diffrent in the Arduino distribution than in the latest avrdude, specifically WRT whether the flash is word-addressed or byte-addressed :-(
1) Changing the watchdog period (inc turning it on) requires paying
attention to synchonization between the WDT clock and system clock.
2) "jmp 512" doesn't work. I'm not sure exactly what happens, but it doesn't go where I expected.
For now, do away with the fancy reset-cause logic and revert to old-style bootloader behavior. Don't even do the no-wait mod; at least this permits you to enter the bootloader by power-cycle.
Implement LED_INVERT for boards that have the blink LED between +5V and pin.
Now working on ATtiny416 Xplained Mini!
Try to add a dummy "application" for freshly programmed parts, that will keep running the bootloader instead of keep running the empty app. (Doesn't work, though. MPLAB won't program it!)
Clean up some obsolete comments.
Eliminate RTC-based LED flashing code in favor of busy loop, which is significantly shorter now that peripherals are not in range of quick IO instructions.
Minor formatting changes while the code is young (notably spaces after the function name at the spot where they're actually defined, which makes them easier to search for. Ancient corporate coding style guideline...)