Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules
dist
*.log
.idea
4 changes: 2 additions & 2 deletions benchmark/index.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/cpu.ts → src/cpu/cpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Copyright (C) 2019, Uri Shaked
*/

import { u16, u8 } from './types';
import { u16, u8 } from '../types';

const registerSpace = 0x100;

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/instruction.ts → src/cpu/instruction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { ICPU } from './cpu';
import { u16 } from './types';
import { u16 } from '../types';

function isTwoWordInstruction(opcode: u16) {
return (
Expand Down
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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';
2 changes: 1 addition & 1 deletion src/gpio.spec.ts → src/peripherals/gpio.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CPU } from './cpu';
import { CPU } from '../cpu/cpu';
import { AVRIOPort, portBConfig, PinState } from './gpio';

describe('GPIO', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/gpio.ts → src/peripherals/gpio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/timer.spec.ts → src/peripherals/timer.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CPU } from './cpu';
import { CPU } from '../cpu/cpu';
import { AVRTimer, timer0Config, timer2Config } from './timer';

describe('timer', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/timer.ts → src/peripherals/timer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/twi.spec.ts → src/peripherals/twi.spec.ts
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
6 changes: 3 additions & 3 deletions src/twi.ts → src/peripherals/twi.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/usart.spec.ts → src/peripherals/usart.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CPU } from './cpu';
import { CPU } from '../cpu/cpu';
import { AVRUSART, usart0Config } from './usart';

const FREQ_16MHZ = 16e6;
Expand Down
6 changes: 3 additions & 3 deletions src/usart.ts → src/peripherals/usart.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down