When debugging the following program in the plugin. The microcontroller returns a pc that points to a datasection, and immediately the microcontroller resets without throwing a clear error.
import {digitalRead,
digitalWrite,
PinVoltage,
pinMode,
PinMode} from "as-warduino";
const button: u32 = 25;
const led: u32 = 26;
let state: PinVoltage = PinVoltage.LOW;
function init(): void {
pinMode(led, PinMode.OUTPUT);
pinMode(button, PinMode.INPUT);
}
export function main(): void {
state = digitalRead(button);
if (state === PinVoltage.HIGH) {
digitalWrite(led, PinVoltage.HIGH);
} else {
digitalWrite(led, PinVoltage.LOW);
}
}
When debugging the following program in the plugin. The microcontroller returns a pc that points to a datasection, and immediately the microcontroller resets without throwing a clear error.
At the if instruction we get:
When we step we get
END
, I don't know what causes this or what it means.This happens right after the if instruction:
But 3346 is
d12
in hex. This address points to a data segment.The code and compiled files: code.zip
Screenshot: