aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libs-device/osctune.h10
-rw-r--r--usbdrv/Changelog.txt3
2 files changed, 8 insertions, 5 deletions
diff --git a/libs-device/osctune.h b/libs-device/osctune.h
index f8bfa97..e359c38 100644
--- a/libs-device/osctune.h
+++ b/libs-device/osctune.h
@@ -59,10 +59,10 @@ macro tuneOsccal
sts lastTimer0Value, YL ;[5]
sub YL, YH ;[7] time passed since last frame
subi YL, EXPECTED_TIMER0_INCREMENT ;[8]
-#if OSCCAL > 0x3f
- lds YH, 0x20 + OSCCAL ;[6]
+#if OSCCAL > 0x3f /* outside I/O addressable range */
+ lds YH, OSCCAL ;[6]
#else
- in YH, OSCCAL ;[6]
+ in YH, OSCCAL ;[6] assembler modle uses __SFR_OFFSET == 0
#endif
cpi YL, TOLERATED_DEVIATION + 1 ;[10]
brmi notTooHigh ;[11]
@@ -75,8 +75,8 @@ notTooHigh:
inc YH ;[15] clock rate was too low
; breq tuningOverflow ; optionally check for overflow
osctuneDone:
-#if OSCCAL > 0x3f
- sts 0x20 + OSCCAL, YH ;[12-13] store tuned value
+#if OSCCAL > 0x3f /* outside I/O addressable range */
+ sts OSCCAL, YH ;[12-13] store tuned value
#else
out OSCCAL, YH ;[12-13] store tuned value
#endif
diff --git a/usbdrv/Changelog.txt b/usbdrv/Changelog.txt
index e456011..3073502 100644
--- a/usbdrv/Changelog.txt
+++ b/usbdrv/Changelog.txt
@@ -254,3 +254,6 @@ Scroll down to the bottom to see the most recent changes.
- Implemented option USB_CFG_SUPPRESS_INTR_CODE.
* Release 2008-10-22
+
+ - Fixed libs-device/osctune.h: OSCCAL is memory address on ATMega88 and
+ similar, not offset of 0x20 needs to be added.