Repository navigation
Fix issues #21 to #27 for the next release - #28
Merged
Merged
Conversation
RCALL added its signed offset as an unsigned 16-bit value, so on an ATmega2560 every backward rcall landed 0x10000 words too high. The 328P hid it because its flash length divides 0x10000. RET/RETI subtracted 1 from the low 16 bits before OR-ing in the high byte, so a return address whose low word is zero lost its high byte. Both now do the arithmetic on the full address.
An input pin whose PORT bit is set reads 1 while nothing drives it. A pin counts as driven from the first SetPinValue until the new ReleasePin, so an embedder that injects every input on every step sees no change. Enabling the pull-up on a floating pin now raises the pin-change edge the chip does. Gpio.PortWrite and Gpio.PinToggle asserted a floating pull-up reading 0 and now expect the silicon value.
…24) START and STOP take one SCL period, an address or data byte nine, at 16 + 2 * TWBR * prescaler CPU cycles per period, before TWINT is raised. The time counts from the dispatch to the ITwiEventHandler, so a handler that completes later adds no extra delay. EmulateBusTiming = false restores the next-cycle completion.
REFS1:0 is 00 AREF, 01 AVCC, 10 reserved, 11 internal 1.1 V (table 28-3). The table was the ATmega8's, so analogReference(INTERNAL) converted against 2.56 V. Also adds Atmega2560AdcConfig (16 channels, MUX5 selects ADC8-15); MUX5 is ignored on 8-channel configs.
…put (#25) The predicate ran on every instruction against a string rebuilt from all the bytes received so far, so long runs that print were quadratic in the output. SerialProbe.Text is cached until the next byte, and the text predicates run only when the probe's version changes. The core was checked across the 2^31 and 2^32 cycle boundaries and was not the cause; CycleBoundaryTests pins clock events and Timer0 there.
…ode (#26, #27) ArduinoUnoSimulation and ArduinoMegaSimulation mount SPI, TWI, ADC and the watchdog. The SPI and TWI device stubs move from the native layer into TestKit.Core (Avr8Sharp.TestKit.Probes) so the boards and the C ABI share one wiring. AvrWatchdog owns MCUSR: PORF on power-on, EXTRF on any other CPU reset, WDRF on a watchdog reset, and a flag clears only on a written zero. UnmountedAccess (Ignore by default, Warn, Throw) reports a read or write of PINx/DDRx/PORTx of a port that was never added; its hooks are only installed when the mode leaves Ignore. C ABI: a8s_set_strict, a8s_read_warnings, a8s_gpio_release_pin. Python: Simulation.with_strict, Simulation.warnings, Port.release, and adc/spi/twi on ArduinoMega.
Deploying avr8sharp-docs with
|
| Latest commit: |
9625733
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f5182228.avr8sharp-docs.pages.dev |
| Branch Preview URL: | https://fix-release-issues-21-27.avr8sharp-docs.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves the open emulator issues ahead of the next release. The main consumer in mind is iCircuit (CircuitMirror), which runs Uno and Mega sketches on the core through
AvrRunner.Core
RCALLon 22-bit-PC parts landed 0x10000 words too high, so the ATmega2560 could not run.RET/RETIalso lost the high byte when the low word of the return address was zero.PINxreads the internal pull-up on a floating input.SetPinValuemarks a pin driven until the newReleasePin, so a host that injects every input each step (CircuitMirror) sees no change.Gpio.PortWriteandGpio.PinTogglenow expect the silicon value.16 + 2*TWBR*prescalercycles per SCL period (1 for START and STOP, 9 per byte), counted from the dispatch to the handler, so a handler that completes late adds nothing. Opt out withAvrTwi.EmulateBusTiming = false.analogReference(INTERNAL)used 2.56 V instead of 1.1 V. AddsAtmega2560AdcConfig(16 channels via MUX5).AvrWatchdogowns MCUSR: PORF on power-on, EXTRF on other resets, WDRF on watchdog reset, and flags clear only on a written zero.TestKit / C ABI / Python
RunUntilSerialrebuilt the whole serial text on every instruction, which made long runs quadratic. It is now cached and the predicate runs only on new output. The core was checked across the 2^31 and 2^32 cycle boundaries and was not the cause.UnmountedAccess: Ignore/Warn/Throw) for unmounted ports. It costs nothing when off.a8s_set_strict,a8s_read_warnings,a8s_gpio_release_pin. New Python API:with_strict,warnings,Port.release.Verification
Avr8Sharp.Tests: 583/583 (was 548)TestKit.Samples: 45/45 (was 21)#23 was already fixed on
mainin f2a1178.Closes #21, closes #22, closes #24, closes #25, closes #26, closes #27.