aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--demo/src/execute.ts10
-rw-r--r--demo/src/index.ts1
-rw-r--r--src/cpu/cpu.ts3
-rw-r--r--src/cpu/instruction.spec.ts4
-rw-r--r--src/cpu/instruction.ts2
-rw-r--r--src/index.ts6
-rw-r--r--src/peripherals/gpio.spec.ts4
-rw-r--r--src/utils/test-utils.ts2
8 files changed, 15 insertions, 17 deletions
diff --git a/demo/src/execute.ts b/demo/src/execute.ts
index 805ce9a..49b4317 100644
--- a/demo/src/execute.ts
+++ b/demo/src/execute.ts
@@ -3,16 +3,16 @@
import {
avrInstruction,
- AVRTimer,
- CPU,
- timer0Config,
- timer1Config,
- timer2Config,
AVRIOPort,
+ AVRTimer,
AVRUSART,
+ CPU,
portBConfig,
portCConfig,
portDConfig,
+ timer0Config,
+ timer1Config,
+ timer2Config,
usart0Config,
} from 'avr8js';
import { loadHex } from './intelhex';
diff --git a/demo/src/index.ts b/demo/src/index.ts
index 2d35403..06f1888 100644
--- a/demo/src/index.ts
+++ b/demo/src/index.ts
@@ -50,7 +50,6 @@ const led12 = document.querySelector<LEDElement>('wokwi-led[color=red]');
// Set up toolbar
let runner: AVRRunner;
-/* eslint-disable @typescript-eslint/no-use-before-define */
const runButton = document.querySelector('#run-button');
runButton.addEventListener('click', compileAndRun);
const stopButton = document.querySelector('#stop-button');
diff --git a/src/cpu/cpu.ts b/src/cpu/cpu.ts
index 62ff40a..4065b0a 100644
--- a/src/cpu/cpu.ts
+++ b/src/cpu/cpu.ts
@@ -9,7 +9,7 @@
*/
import { AVRIOPort } from '../peripherals/gpio';
-import { u32, u16, u8, i16 } from '../types';
+import { i16, u16, u32, u8 } from '../types';
import { avrInterrupt } from './interrupt';
const registerSpace = 0x100;
@@ -262,7 +262,6 @@ export class CPU {
const { nextInterrupt } = this;
if (this.interruptsEnabled && nextInterrupt >= 0) {
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const interrupt = this.pendingInterrupts[nextInterrupt]!;
avrInterrupt(this, interrupt.address);
if (!interrupt.constant) {
diff --git a/src/cpu/instruction.spec.ts b/src/cpu/instruction.spec.ts
index aa01876..181b2fa 100644
--- a/src/cpu/instruction.spec.ts
+++ b/src/cpu/instruction.spec.ts
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: MIT
// Copyright (c) Uri Shaked and contributors
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+import { assemble } from '../utils/assembler';
import { CPU } from './cpu';
import { avrInstruction } from './instruction';
-import { assemble } from '../utils/assembler';
-import { describe, it, expect, vi, beforeEach } from 'vitest';
const r0 = 0;
const r1 = 1;
diff --git a/src/cpu/instruction.ts b/src/cpu/instruction.ts
index d815733..77f27ba 100644
--- a/src/cpu/instruction.ts
+++ b/src/cpu/instruction.ts
@@ -13,8 +13,8 @@
* Copyright (C) 2019, 2020 Uri Shaked
*/
-import { CPU } from './cpu';
import { u16 } from '../types';
+import { CPU } from './cpu';
function isTwoWordInstruction(opcode: u16) {
return (
diff --git a/src/index.ts b/src/index.ts
index 51ca120..9f8d27a 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -6,16 +6,16 @@ export type { CPUMemoryHook, CPUMemoryHooks } from './cpu/cpu';
export { avrInstruction } from './cpu/instruction';
export { avrInterrupt } from './cpu/interrupt';
export {
- adcConfig,
ADCMuxInputType,
ADCReference,
- atmega328Channels,
AVRADC,
+ adcConfig,
+ atmega328Channels,
} from './peripherals/adc';
export type { ADCConfig, ADCMuxConfiguration, ADCMuxInput } from './peripherals/adc';
export { AVRClock, clockConfig } from './peripherals/clock';
export type { AVRClockConfig } from './peripherals/clock';
-export { AVREEPROM, eepromConfig, EEPROMMemoryBackend } from './peripherals/eeprom';
+export { AVREEPROM, EEPROMMemoryBackend, eepromConfig } from './peripherals/eeprom';
export type { AVREEPROMConfig, EEPROMBackend } from './peripherals/eeprom';
export {
AVRIOPort,
diff --git a/src/peripherals/gpio.spec.ts b/src/peripherals/gpio.spec.ts
index 40d4660..4927446 100644
--- a/src/peripherals/gpio.spec.ts
+++ b/src/peripherals/gpio.spec.ts
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: MIT
// Copyright (c) Uri Shaked and contributors
+import { describe, expect, it, vi } from 'vitest';
import { CPU } from '../cpu/cpu';
import { asmProgram, TestProgramRunner } from '../utils/test-utils';
-import { AVRIOPort, portBConfig, PinState, portDConfig, PinOverrideMode } from './gpio';
-import { describe, it, expect, vi } from 'vitest';
+import { AVRIOPort, PinOverrideMode, PinState, portBConfig, portDConfig } from './gpio';
// CPU registers
const SREG = 95;
diff --git a/src/utils/test-utils.ts b/src/utils/test-utils.ts
index 8083790..c6812f9 100644
--- a/src/utils/test-utils.ts
+++ b/src/utils/test-utils.ts
@@ -2,8 +2,8 @@
// Copyright (c) Uri Shaked and contributors
import { CPU } from '../cpu/cpu';
-import { assemble } from './assembler';
import { avrInstruction } from '../cpu/instruction';
+import { assemble } from './assembler';
const BREAK_OPCODE = 0x9598;