diff options
| author | Uri Shaked | 2025-02-11 10:31:57 +0200 |
|---|---|---|
| committer | Uri Shaked | 2025-02-11 10:31:57 +0200 |
| commit | 9ce22e49cf1110d0a8c1943877dc32e6568354cc (patch) | |
| tree | 6ad61569ee9a311b5ca8f330948b2136b2c04ed5 | |
| parent | chore: replace ts-node with tsx (diff) | |
| download | avr8js-9ce22e49cf1110d0a8c1943877dc32e6568354cc.tar.gz avr8js-9ce22e49cf1110d0a8c1943877dc32e6568354cc.tar.bz2 avr8js-9ce22e49cf1110d0a8c1943877dc32e6568354cc.zip | |
chore(deps): upgrade prettier
reformat all code with the new prettier version
Diffstat (limited to '')
| -rw-r--r-- | benchmark/benchmark.ts | 4 | ||||
| -rw-r--r-- | demo/index.html | 2 | ||||
| -rw-r--r-- | demo/src/cpu-performance.ts | 5 | ||||
| -rw-r--r-- | package-lock.json | 148 | ||||
| -rw-r--r-- | package.json | 7 | ||||
| -rw-r--r-- | src/cpu/cpu.ts | 5 | ||||
| -rw-r--r-- | src/cpu/instruction.ts | 8 | ||||
| -rw-r--r-- | src/peripherals/adc.ts | 5 | ||||
| -rw-r--r-- | src/peripherals/clock.ts | 2 | ||||
| -rw-r--r-- | src/peripherals/eeprom.ts | 2 | ||||
| -rw-r--r-- | src/peripherals/gpio.ts | 7 | ||||
| -rw-r--r-- | src/peripherals/spi.ts | 6 | ||||
| -rw-r--r-- | src/peripherals/timer.ts | 5 | ||||
| -rw-r--r-- | src/peripherals/twi.ts | 6 | ||||
| -rw-r--r-- | src/peripherals/usart.ts | 6 | ||||
| -rw-r--r-- | src/peripherals/watchdog.ts | 6 | ||||
| -rw-r--r-- | src/utils/test-utils.ts | 2 |
17 files changed, 160 insertions, 66 deletions
diff --git a/benchmark/benchmark.ts b/benchmark/benchmark.ts index b99aa06..51c43b4 100644 --- a/benchmark/benchmark.ts +++ b/benchmark/benchmark.ts @@ -78,7 +78,7 @@ export function createBenchmark(benchmarkName: string): Benchmark { // As a sanity if duration_ms is 0 just double the count. profile.iterationCount << 1, // Otherwise try to guess how many iterations we have to do to get the right time. - Math.round((MIN_SAMPLE_DURATION / durationMs) * profile.iterationCount) + Math.round((MIN_SAMPLE_DURATION / durationMs) * profile.iterationCount), ); profile.noImprovementCount = 0; runAgain = true; @@ -120,7 +120,7 @@ export function createBenchmark(benchmarkName: string): Benchmark { const percent = (100 - (profile.bestTime / fastest.bestTime) * 100).toFixed(0); return ' ' + profile.profileName + ': ' + time + ' ' + unit + '(' + percent + '%)'; }) - .join('\n')}` + .join('\n')}`, ); }; return benchmark; diff --git a/demo/index.html b/demo/index.html index 0639147..c5a2068 100644 --- a/demo/index.html +++ b/demo/index.html @@ -1,4 +1,4 @@ -<!DOCTYPE html> +<!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> diff --git a/demo/src/cpu-performance.ts b/demo/src/cpu-performance.ts index a4afc73..1b1261e 100644 --- a/demo/src/cpu-performance.ts +++ b/demo/src/cpu-performance.ts @@ -6,7 +6,10 @@ export class CPUPerformance { private samples = new Float32Array(64); private sampleIndex = 0; - constructor(private cpu: CPU, private MHZ: number) {} + constructor( + private cpu: CPU, + private MHZ: number, + ) {} reset() { this.prevTime = 0; diff --git a/package-lock.json b/package-lock.json index 14b1fb3..11f78d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,18 +10,17 @@ "license": "MIT", "devDependencies": { "@types/node": "^18.0.0", - "@types/prettier": "^2.3.2", "@typescript-eslint/eslint-plugin": "^5.48.0", "@typescript-eslint/parser": "^5.48.0", "@wokwi/elements": "^0.16.2", "acorn": "^7.3.1", "eslint": "^8.31.0", - "eslint-config-prettier": "^8.6.0", + "eslint-config-prettier": "^10.0.1", "eslint-plugin-json": "^3.1.0", - "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-prettier": "^5.1.3", "husky": "^6.0.0", "lint-staged": "^9.5.0", - "prettier": "^2.3.2", + "prettier": "^3.5.0", "rimraf": "^3.0.2", "tsx": "^4.19.2", "typescript": "^4.9.4", @@ -557,6 +556,19 @@ "node": ">= 8" } }, + "node_modules/@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.34.6", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.6.tgz", @@ -882,12 +894,6 @@ "undici-types": "~5.26.4" } }, - "node_modules/@types/prettier": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.1.tgz", - "integrity": "sha512-Fo79ojj3vdEZOHg3wR9ksAMRz4P3S5fDB5e/YWZiFnyFQI1WY2Vftu9XoXVVtJfxB7Bpce/QTqWSSntkz2Znrw==", - "dev": true - }, "node_modules/@types/semver": { "version": "7.3.13", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", @@ -1847,12 +1853,13 @@ } }, "node_modules/eslint-config-prettier": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz", - "integrity": "sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.0.1.tgz", + "integrity": "sha512-lZBts941cyJyeaooiKxAtzoPHTN+GbQTJFAIdQbRhA4/8whaAraEh47Whw/ZFfrjNSnlAxqfm9i0XVAEkULjCw==", "dev": true, + "license": "MIT", "bin": { - "eslint-config-prettier": "bin/cli.js" + "eslint-config-prettier": "build/bin/cli.js" }, "peerDependencies": { "eslint": ">=7.0.0" @@ -1872,21 +1879,31 @@ } }, "node_modules/eslint-plugin-prettier": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", - "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.3.tgz", + "integrity": "sha512-qJ+y0FfCp/mQYQ/vWQ3s7eUlFEL4PyKfAJxsnYTJ4YT73nsJBWqmEpFryxV9OeUiqmsTsYJ5Y+KDNaeP31wrRw==", "dev": true, + "license": "MIT", "dependencies": { - "prettier-linter-helpers": "^1.0.0" + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.9.1" }, "engines": { - "node": ">=12.0.0" + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" }, "peerDependencies": { - "eslint": ">=7.28.0", - "prettier": ">=2.0.0" + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": "*", + "prettier": ">=3.0.0" }, "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, "eslint-config-prettier": { "optional": true } @@ -3502,15 +3519,19 @@ } }, "node_modules/prettier": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz", - "integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.0.tgz", + "integrity": "sha512-quyMrVt6svPS7CjQ9gKb3GLEX/rl3BCL2oa/QkNcXv4YNVBC9olt3s+H7ukto06q7B1Qz46PbrKLO34PR6vXcA==", "dev": true, + "license": "MIT", "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" } }, "node_modules/prettier-linter-helpers": { @@ -3874,6 +3895,30 @@ "node": ">=0.10.0" } }, + "node_modules/synckit": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.2.tgz", + "integrity": "sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/synckit/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -5032,6 +5077,12 @@ "fastq": "^1.6.0" } }, + "@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "dev": true + }, "@rollup/rollup-android-arm-eabi": { "version": "4.34.6", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.6.tgz", @@ -5211,12 +5262,6 @@ "undici-types": "~5.26.4" } }, - "@types/prettier": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.1.tgz", - "integrity": "sha512-Fo79ojj3vdEZOHg3wR9ksAMRz4P3S5fDB5e/YWZiFnyFQI1WY2Vftu9XoXVVtJfxB7Bpce/QTqWSSntkz2Znrw==", - "dev": true - }, "@types/semver": { "version": "7.3.13", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", @@ -6031,9 +6076,9 @@ } }, "eslint-config-prettier": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz", - "integrity": "sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.0.1.tgz", + "integrity": "sha512-lZBts941cyJyeaooiKxAtzoPHTN+GbQTJFAIdQbRhA4/8whaAraEh47Whw/ZFfrjNSnlAxqfm9i0XVAEkULjCw==", "dev": true, "requires": {} }, @@ -6048,12 +6093,13 @@ } }, "eslint-plugin-prettier": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", - "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.3.tgz", + "integrity": "sha512-qJ+y0FfCp/mQYQ/vWQ3s7eUlFEL4PyKfAJxsnYTJ4YT73nsJBWqmEpFryxV9OeUiqmsTsYJ5Y+KDNaeP31wrRw==", "dev": true, "requires": { - "prettier-linter-helpers": "^1.0.0" + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.9.1" } }, "eslint-scope": { @@ -7122,9 +7168,9 @@ "dev": true }, "prettier": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz", - "integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.0.tgz", + "integrity": "sha512-quyMrVt6svPS7CjQ9gKb3GLEX/rl3BCL2oa/QkNcXv4YNVBC9olt3s+H7ukto06q7B1Qz46PbrKLO34PR6vXcA==", "dev": true }, "prettier-linter-helpers": { @@ -7369,6 +7415,24 @@ "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", "dev": true }, + "synckit": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.2.tgz", + "integrity": "sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==", + "dev": true, + "requires": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "dependencies": { + "tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true + } + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", diff --git a/package.json b/package.json index 6b32f1a..e0ff8f8 100644 --- a/package.json +++ b/package.json @@ -36,18 +36,17 @@ ], "devDependencies": { "@types/node": "^18.0.0", - "@types/prettier": "^2.3.2", "@typescript-eslint/eslint-plugin": "^5.48.0", "@typescript-eslint/parser": "^5.48.0", "@wokwi/elements": "^0.16.2", "acorn": "^7.3.1", "eslint": "^8.31.0", - "eslint-config-prettier": "^8.6.0", + "eslint-config-prettier": "^10.0.1", "eslint-plugin-json": "^3.1.0", - "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-prettier": "^5.1.3", "husky": "^6.0.0", "lint-staged": "^9.5.0", - "prettier": "^2.3.2", + "prettier": "^3.5.0", "rimraf": "^3.0.2", "tsx": "^4.19.2", "typescript": "^4.9.4", diff --git a/src/cpu/cpu.ts b/src/cpu/cpu.ts index d26ef8f..cd9e3e4 100644 --- a/src/cpu/cpu.ts +++ b/src/cpu/cpu.ts @@ -80,7 +80,10 @@ export class CPU { nextInterrupt: i16 = -1; maxInterrupt: i16 = 0; - constructor(public progMem: Uint16Array, private sramBytes = 8192) { + constructor( + public progMem: Uint16Array, + private sramBytes = 8192, + ) { this.reset(); } diff --git a/src/cpu/instruction.ts b/src/cpu/instruction.ts index e2bed5d..d29bfb8 100644 --- a/src/cpu/instruction.ts +++ b/src/cpu/instruction.ts @@ -393,7 +393,7 @@ export function avrInstruction(cpu: CPU) { cpu.cycles++; cpu.data[(opcode & 0x1f0) >> 4] = cpu.readData( cpu.dataView.getUint16(28, true) + - ((opcode & 7) | ((opcode & 0xc00) >> 7) | ((opcode & 0x2000) >> 8)) + ((opcode & 7) | ((opcode & 0xc00) >> 7) | ((opcode & 0x2000) >> 8)), ); } else if ((opcode & 0xfe0f) === 0x8000) { /* LDZ, 1000 000d dddd 0000 */ @@ -419,7 +419,7 @@ export function avrInstruction(cpu: CPU) { cpu.cycles++; cpu.data[(opcode & 0x1f0) >> 4] = cpu.readData( cpu.dataView.getUint16(30, true) + - ((opcode & 7) | ((opcode & 0xc00) >> 7) | ((opcode & 0x2000) >> 8)) + ((opcode & 7) | ((opcode & 0xc00) >> 7) | ((opcode & 0x2000) >> 8)), ); } else if (opcode === 0x95c8) { /* LPM, 1001 0101 1100 1000 */ @@ -716,7 +716,7 @@ export function avrInstruction(cpu: CPU) { cpu.writeData( cpu.dataView.getUint16(28, true) + ((opcode & 7) | ((opcode & 0xc00) >> 7) | ((opcode & 0x2000) >> 8)), - cpu.data[(opcode & 0x1f0) >> 4] + cpu.data[(opcode & 0x1f0) >> 4], ); cpu.cycles++; } else if ((opcode & 0xfe0f) === 0x8200) { @@ -744,7 +744,7 @@ export function avrInstruction(cpu: CPU) { cpu.writeData( cpu.dataView.getUint16(30, true) + ((opcode & 7) | ((opcode & 0xc00) >> 7) | ((opcode & 0x2000) >> 8)), - cpu.data[(opcode & 0x1f0) >> 4] + cpu.data[(opcode & 0x1f0) >> 4], ); cpu.cycles++; } else if ((opcode & 0xfc00) === 0x1800) { diff --git a/src/peripherals/adc.ts b/src/peripherals/adc.ts index 1e0e2d1..16ccdba 100644 --- a/src/peripherals/adc.ts +++ b/src/peripherals/adc.ts @@ -163,7 +163,10 @@ export class AVRADC { enableMask: ADIE, }; - constructor(private cpu: CPU, private config: ADCConfig) { + constructor( + private cpu: CPU, + private config: ADCConfig, + ) { cpu.writeHooks[config.ADCSRA] = (value, oldValue) => { if (value & ADEN && !(oldValue && ADEN)) { this.conversionCycles = 25; diff --git a/src/peripherals/clock.ts b/src/peripherals/clock.ts index d443843..bf49ac9 100644 --- a/src/peripherals/clock.ts +++ b/src/peripherals/clock.ts @@ -35,7 +35,7 @@ export class AVRClock { constructor( private cpu: CPU, private baseFreqHz: u32, - private config: AVRClockConfig = clockConfig + private config: AVRClockConfig = clockConfig, ) { this.cpu.writeHooks[this.config.CLKPR] = (clkpr) => { if ((!this.clockEnabledCycles || this.clockEnabledCycles < cpu.cycles) && clkpr === CLKPCE) { diff --git a/src/peripherals/eeprom.ts b/src/peripherals/eeprom.ts index 045ffe8..98c2cc6 100644 --- a/src/peripherals/eeprom.ts +++ b/src/peripherals/eeprom.ts @@ -85,7 +85,7 @@ export class AVREEPROM { constructor( private cpu: CPU, private backend: EEPROMBackend, - private config: AVREEPROMConfig = eepromConfig + private config: AVREEPROMConfig = eepromConfig, ) { this.cpu.writeHooks[this.config.EECR] = (eecr) => { const { EEARH, EEARL, EECR, EEDR } = this.config; diff --git a/src/peripherals/gpio.ts b/src/peripherals/gpio.ts index 0da9d50..92435b9 100644 --- a/src/peripherals/gpio.ts +++ b/src/peripherals/gpio.ts @@ -219,7 +219,10 @@ export class AVRIOPort { private lastPin: u8 = 0; openCollector: u8 = 0; - constructor(private cpu: CPU, readonly portConfig: Readonly<AVRPortConfig>) { + constructor( + private cpu: CPU, + readonly portConfig: Readonly<AVRPortConfig>, + ) { cpu.gpioPorts.add(this); cpu.gpioByPort[portConfig.PORT] = this; @@ -259,7 +262,7 @@ export class AVRIOPort { enableRegister: externalConfig.EIMSK, enableMask: 1 << externalConfig.index, } - : null + : null, ); const EICR = new Set(externalInterrupts.map((item) => item?.EICR)); for (const EICRx of EICR) { diff --git a/src/peripherals/spi.ts b/src/peripherals/spi.ts index 3167c07..824b13a 100644 --- a/src/peripherals/spi.ts +++ b/src/peripherals/spi.ts @@ -63,7 +63,11 @@ export class AVRSPI { enableMask: SPCR_SPIE, }; - constructor(private cpu: CPU, private config: SPIConfig, private freqHz: number) { + constructor( + private cpu: CPU, + private config: SPIConfig, + private freqHz: number, + ) { const { SPCR, SPSR, SPDR } = config; cpu.writeHooks[SPDR] = (value: u8) => { if (!(cpu.data[SPCR] & SPCR_SPE)) { diff --git a/src/peripherals/timer.ts b/src/peripherals/timer.ts index 93b9d19..dfbba35 100644 --- a/src/peripherals/timer.ts +++ b/src/peripherals/timer.ts @@ -342,7 +342,10 @@ export class AVRTimer { enableMask: this.config.OCIEC, }; - constructor(private cpu: CPU, private config: AVRTimerConfig) { + constructor( + private cpu: CPU, + private config: AVRTimerConfig, + ) { this.updateWGMConfig(); this.cpu.readHooks[config.TCNT] = (addr: u8) => { this.count(false); diff --git a/src/peripherals/twi.ts b/src/peripherals/twi.ts index 9af1749..3d0275c 100644 --- a/src/peripherals/twi.ts +++ b/src/peripherals/twi.ts @@ -105,7 +105,11 @@ export class AVRTWI { enableMask: TWCR_TWIE, }; - constructor(private cpu: CPU, private config: TWIConfig, private freqHz: number) { + constructor( + private cpu: CPU, + private config: TWIConfig, + private freqHz: number, + ) { this.updateStatus(STATUS_TWI_IDLE); this.cpu.writeHooks[config.TWCR] = (value) => { this.cpu.data[config.TWCR] = value; diff --git a/src/peripherals/usart.ts b/src/peripherals/usart.ts index 1b7546b..9babe16 100644 --- a/src/peripherals/usart.ts +++ b/src/peripherals/usart.ts @@ -109,7 +109,11 @@ export class AVRUSART { enableMask: UCSRB_TXCIE, }; - constructor(private cpu: CPU, private config: USARTConfig, private freqHz: number) { + constructor( + private cpu: CPU, + private config: USARTConfig, + private freqHz: number, + ) { this.reset(); this.cpu.writeHooks[config.UCSRA] = (value, oldValue) => { cpu.data[config.UCSRA] = value & (UCSRA_MPCM | UCSRA_U2X); diff --git a/src/peripherals/watchdog.ts b/src/peripherals/watchdog.ts index dc66220..979151f 100644 --- a/src/peripherals/watchdog.ts +++ b/src/peripherals/watchdog.ts @@ -57,7 +57,11 @@ export class AVRWatchdog { enableMask: WDTCSR_WDIE, }; - constructor(private cpu: CPU, private config: WatchdogConfig, private clock: AVRClock) { + constructor( + private cpu: CPU, + private config: WatchdogConfig, + private clock: AVRClock, + ) { const { WDTCSR } = config; this.cpu.onWatchdogReset = () => { this.resetWatchdog(); diff --git a/src/utils/test-utils.ts b/src/utils/test-utils.ts index e620748..90558d5 100644 --- a/src/utils/test-utils.ts +++ b/src/utils/test-utils.ts @@ -19,7 +19,7 @@ const defaultOnBreak = () => { export class TestProgramRunner { constructor( private readonly cpu: CPU, - private readonly onBreak: (cpu: CPU) => void = defaultOnBreak + private readonly onBreak: (cpu: CPU) => void = defaultOnBreak, ) {} runInstructions(count: number) { |
