After you have copied the repository, or repo for short, you'll want to go into the adafruit_platformdetect/constants folder. Here you will find a couple of files named boards.py and chips.py. This is where you will add your constants for the board and chip files.

Before adding a new chip constant, check to make sure it doesn't already exist. If it does, that will make adding your board much easier.

chips.py Constants

These should just be in the format with the string value matching the constant name, so for the Pine A64 chip, we would add:

A64 = "A64"

If you are using a longer name with multiple words, they should be separated by underscores.

boards.py Constants

Board constants should be in the same format as the chip so, for the Pine64 we can add it like:

PINE64 = "PINE64"

Next, the new board constant may need to be added to a group as well. If the new board you are adding is from the same manufacturer as an existing board, you should either add it to that group, if one exists, or create a new group. For the Pine64, there was already a couple other boards, so we will just make sure the new ID is inside the group.

_PINE64_DEV_IDS = (
PINE64,
PINEBOOK,
PINEPHONE
)

This guide was first published on Mar 17, 2020. It was last updated on Mar 17, 2020.

This page (Adding the Constants) was last updated on Jan 13, 2021.

Text editor powered by tinymce.