-
Notifications
You must be signed in to change notification settings - Fork 83
Closed
Description
I would like to refactor the existing ATmega328p implementation to utilize the implementation mentioned in pull request 138: Add ATmega32
Definition of done:
- Refactor the existing ATmega328p chip details in a single file named
src/chips/ATmega328p.ts
- Implement the
CreateAVR
function as provided in the ATMega32 effort npm test
reports all tests passednpm start
demo shows a blinking led
My ultimate goal is to add the ATtiny841 and believe this is a solid step towards adding any new chip, ATtiny841, ATmega32, and so on.
Here is a GIST for ADC testing. Created this section to convey one possible approach. Open to other ideas.
import { ATmega328p } from '../chips/ATmega328p';
import { createAVR } from '../create-avr';
. . . SNIP . . .
const avr = createAVR(ATmega328p, { program: program });
const cpu = avr.cpu;
const adc = avr.adc;
const runner = new TestProgramRunner(cpu);
Notice:
createAVR
is being utilized- New / refactored
ATmega328p
configuration is provided as input argument program
remains unchanged from existingcpu
andadc
are instantiated bycreateAVR
using theATmega328p
configuration- in the future new
Chip
configurations could be utilized and tested as needed
Metadata
Metadata
Assignees
Labels
No labels