First of all, thank you for considering contributing to AVR8js! Please go over these guidelines to ensure that your contribution lands successfully.
Before starting to work on a new feature, please file an issue to discuss the implementation.
The source code is written in the TypeScript language, a typed extension of JavaScript.
In addition, we use the following tools:
- prettier to keep the code pretty
- eslint to keep the code consistent and clean
- editorconfig to keep indentation consistent across different editors
- jest for the unit tests
If you open this project with Visual Studio Code, you will be prompted to install the relevant extensions for these tools.
Finally, we recommend using Wallaby.js to run the tests automatically as you write the code. It should work out of the box with this repo, without any extra configuration. You can also run the tests manually, from the commandline (see below).
The demo project allows you to edit Arduino code, compile it, and run it in the simulator. It also simulates 2 LEDs connected to pins 12 and 13 (PB4 and PB5). To run it, simply execute
npm start
Then go to http://localhost:1234/ to interact with the project.
The demo project is packaged using parcel and uses the Monaco Editor for the interactive code editor, and the Wokwi Elements library for displaying the LEDs.
Run the tests once:
npm test
Run the tests of the files you modified since last commit (watch mode):
npm run test:watch
The following datasheets can be useful when working on new AVR8js features or fixing existing code:
- ATmega48A/PA/88A/PA/168A/PA/328/P Datasheet
- The AVR Istruction Set Manual
- ATmega640/V-1280/V-1281/V-2560/V-2561/V Datasheet
Please make sure to follow these guidelines when contributing code:
- You include a relevant test case. Ideally the test case would fail before your code changes, and pass after implementing the change.
- Your commit messages should follow the conventional commits
standard, e.g.:
feat(instruction): implement EICALL, EIJMP
- The contributed code has to be compatible with the MIT license. If your work incoporates some third-party code, please make sure that their license is compatible and that you credit appropriately.
Thank you!