aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--benchmark/index.ts4
-rw-r--r--src/cpu/cpu.spec.ts (renamed from src/cpu.spec.ts)0
-rw-r--r--src/cpu/cpu.ts (renamed from src/cpu.ts)2
-rw-r--r--src/cpu/instruction.spec.ts (renamed from src/instruction.spec.ts)0
-rw-r--r--src/cpu/instruction.ts (renamed from src/instruction.ts)2
-rw-r--r--src/cpu/interrupt.spec.ts (renamed from src/interrupt.spec.ts)0
-rw-r--r--src/cpu/interrupt.ts (renamed from src/interrupt.ts)0
-rw-r--r--src/index.ts14
-rw-r--r--src/peripherals/gpio.spec.ts (renamed from src/gpio.spec.ts)2
-rw-r--r--src/peripherals/gpio.ts (renamed from src/gpio.ts)4
-rw-r--r--src/peripherals/timer.spec.ts (renamed from src/timer.spec.ts)2
-rw-r--r--src/peripherals/timer.ts (renamed from src/timer.ts)4
-rw-r--r--src/peripherals/twi.spec.ts (renamed from src/twi.spec.ts)6
-rw-r--r--src/peripherals/twi.ts (renamed from src/twi.ts)6
-rw-r--r--src/peripherals/usart.spec.ts (renamed from src/usart.spec.ts)2
-rw-r--r--src/peripherals/usart.ts (renamed from src/usart.ts)6
17 files changed, 28 insertions, 27 deletions
diff --git a/.gitignore b/.gitignore
index 92cd86e..3a05d54 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
node_modules
dist
*.log
+.idea
diff --git a/benchmark/index.ts b/benchmark/index.ts
index 02eee8d..e290352 100644
--- a/benchmark/index.ts
+++ b/benchmark/index.ts
@@ -1,5 +1,5 @@
-import { CPU, ICPU } from '../src/cpu';
-import { avrInstruction } from '../src/instruction';
+import { CPU, ICPU } from '../src/cpu/cpu';
+import { avrInstruction } from '../src/cpu/instruction';
import { createBenchmark } from './benchmark';
import { permutations } from './permutations';
import { instructions, executeInstruction } from './instruction-fn';
diff --git a/src/cpu.spec.ts b/src/cpu/cpu.spec.ts
index 92df7ee..92df7ee 100644
--- a/src/cpu.spec.ts
+++ b/src/cpu/cpu.spec.ts
diff --git a/src/cpu.ts b/src/cpu/cpu.ts
index 4288285..93f79d0 100644
--- a/src/cpu.ts
+++ b/src/cpu/cpu.ts
@@ -5,7 +5,7 @@
* Copyright (C) 2019, Uri Shaked
*/
-import { u16, u8 } from './types';
+import { u16, u8 } from '../types';
const registerSpace = 0x100;
diff --git a/src/instruction.spec.ts b/src/cpu/instruction.spec.ts
index 2c5244e..2c5244e 100644
--- a/src/instruction.spec.ts
+++ b/src/cpu/instruction.spec.ts
diff --git a/src/instruction.ts b/src/cpu/instruction.ts
index 9ee52de..7e14aad 100644
--- a/src/instruction.ts
+++ b/src/cpu/instruction.ts
@@ -7,7 +7,7 @@
*/
import { ICPU } from './cpu';
-import { u16 } from './types';
+import { u16 } from '../types';
function isTwoWordInstruction(opcode: u16) {
return (
diff --git a/src/interrupt.spec.ts b/src/cpu/interrupt.spec.ts
index cc54e3c..cc54e3c 100644
--- a/src/interrupt.spec.ts
+++ b/src/cpu/interrupt.spec.ts
diff --git a/src/interrupt.ts b/src/cpu/interrupt.ts
index 1c7d835..1c7d835 100644
--- a/src/interrupt.ts
+++ b/src/cpu/interrupt.ts
diff --git a/src/index.ts b/src/index.ts
index ef0b514..58afde3 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -4,10 +4,10 @@
* Copyright (C) 2019, 2020, Uri Shaked
*/
-export { CPU, ICPU, CPUMemoryHook, CPUMemoryHooks } from './cpu';
-export { avrInstruction } from './instruction';
-export { avrInterrupt } from './interrupt';
-export { AVRTimer, timer0Config, timer1Config, timer2Config } from './timer';
+export { CPU, ICPU, CPUMemoryHook, CPUMemoryHooks } from './cpu/cpu';
+export { avrInstruction } from './cpu/instruction';
+export { avrInterrupt } from './cpu/interrupt';
+export { AVRTimer, timer0Config, timer1Config, timer2Config } from './peripherals/timer';
export {
AVRIOPort,
GPIOListener,
@@ -24,6 +24,6 @@ export {
portKConfig,
portLConfig,
PinState
-} from './gpio';
-export { AVRUSART, usart0Config } from './usart';
-export * from './twi';
+} from './peripherals/gpio';
+export { AVRUSART, usart0Config } from './peripherals/usart';
+export * from './peripherals/twi';
diff --git a/src/gpio.spec.ts b/src/peripherals/gpio.spec.ts
index 2fa866d..5a282e6 100644
--- a/src/gpio.spec.ts
+++ b/src/peripherals/gpio.spec.ts
@@ -1,4 +1,4 @@
-import { CPU } from './cpu';
+import { CPU } from '../cpu/cpu';
import { AVRIOPort, portBConfig, PinState } from './gpio';
describe('GPIO', () => {
diff --git a/src/gpio.ts b/src/peripherals/gpio.ts
index d0df06d..a667967 100644
--- a/src/gpio.ts
+++ b/src/peripherals/gpio.ts
@@ -5,8 +5,8 @@
*
* Copyright (C) 2019, 2020, Uri Shaked
*/
-import { CPU } from './cpu';
-import { u8 } from './types';
+import { CPU } from '../cpu/cpu';
+import { u8 } from '../types';
export interface AVRPortConfig {
// Register addresses
diff --git a/src/timer.spec.ts b/src/peripherals/timer.spec.ts
index 4d631a7..adcef04 100644
--- a/src/timer.spec.ts
+++ b/src/peripherals/timer.spec.ts
@@ -1,4 +1,4 @@
-import { CPU } from './cpu';
+import { CPU } from '../cpu/cpu';
import { AVRTimer, timer0Config, timer2Config } from './timer';
describe('timer', () => {
diff --git a/src/timer.ts b/src/peripherals/timer.ts
index 4a120e7..7e563c2 100644
--- a/src/timer.ts
+++ b/src/peripherals/timer.ts
@@ -6,8 +6,8 @@
* Copyright (C) 2019, Uri Shaked
*/
-import { CPU } from './cpu';
-import { avrInterrupt } from './interrupt';
+import { CPU } from '../cpu/cpu';
+import { avrInterrupt } from '../cpu/interrupt';
const timer01Dividers = {
0: 0,
diff --git a/src/twi.spec.ts b/src/peripherals/twi.spec.ts
index 369f22a..542cf2a 100644
--- a/src/twi.spec.ts
+++ b/src/peripherals/twi.spec.ts
@@ -1,7 +1,7 @@
-import { CPU } from './cpu';
+import { CPU } from '../cpu/cpu';
import { AVRTWI, twiConfig } from './twi';
-import { assemble } from './utils/assembler';
-import { avrInstruction } from './instruction';
+import { assemble } from '../utils/assembler';
+import { avrInstruction } from '../cpu/instruction';
const FREQ_16MHZ = 16e6;
diff --git a/src/twi.ts b/src/peripherals/twi.ts
index fd0645b..ec0a206 100644
--- a/src/twi.ts
+++ b/src/peripherals/twi.ts
@@ -1,6 +1,6 @@
-import { CPU } from './cpu';
-import { avrInterrupt } from './interrupt';
-import { u8 } from './types';
+import { CPU } from '../cpu/cpu';
+import { avrInterrupt } from '../cpu/interrupt';
+import { u8 } from '../types';
export interface TWIEventHandler {
start(repeated: boolean): void;
diff --git a/src/usart.spec.ts b/src/peripherals/usart.spec.ts
index 222017c..d9843dc 100644
--- a/src/usart.spec.ts
+++ b/src/peripherals/usart.spec.ts
@@ -1,4 +1,4 @@
-import { CPU } from './cpu';
+import { CPU } from '../cpu/cpu';
import { AVRUSART, usart0Config } from './usart';
const FREQ_16MHZ = 16e6;
diff --git a/src/usart.ts b/src/peripherals/usart.ts
index 6838736..b93c0ea 100644
--- a/src/usart.ts
+++ b/src/peripherals/usart.ts
@@ -1,6 +1,6 @@
-import { CPU } from './cpu';
-import { avrInterrupt } from './interrupt';
-import { u8 } from './types';
+import { CPU } from '../cpu/cpu';
+import { avrInterrupt } from '../cpu/interrupt';
+import { u8 } from '../types';
export interface USARTConfig {
rxCompleteInterrupt: u8;
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.