This commit is contained in:
Michal Moskal 2021-02-11 17:56:57 -08:00
Родитель d6dcf29e4f
Коммит 9ea9fa001b
3 изменённых файлов: 14 добавлений и 5 удалений

Просмотреть файл

@ -104,7 +104,8 @@ Other than the building/deployment targets, the following might be of note:
* you likely do not need to edit [targets/acme-corp/config.mk](targets/_example/config.mk), even if using
a beefier MCU from the F03x family - they should be backward-compatible
* edit [targets/acme-corp/profile/module.c](targets/_example/profile/module.c)
to include your module name and used services (follow comments in `module.c`)
to include your module name and used services (follow comments in `module.c`);
see [jd_service_initializers.h](jacdac-c/services/interfaces/jd_service_initializers.h) for list of services
* rename `module.c` to match the type of module (eg. `servo.c`)
* if you have several modules with non-conflicting `board.h` definitions,
you can create more files under `targets/acme-corp/profile/`

@ -1 +1 @@
Subproject commit 8f152957d6c88ab8dc77c0bdb0809c31849d7354
Subproject commit df512570c65b43a50983d888bef896c92e540e55

Просмотреть файл

@ -5,8 +5,16 @@
// Do not change the 0x3.... value, as that would break the firmware update process.
FIRMWARE_IDENTIFIER(0x0, "Example Corp. Servo Rev.A");
const servo_params_t servo_params = {
.pin = PA_7,
.min_angle = -90 << 16, // -90.000deg
.min_pulse = 500, // 500us
.max_angle = 90 << 16, // +90.000deg
.max_pulse = 2500, // 2500us
};
void app_init_services() {
// see jacdac-c/services/interfaces/jd_service_initializers.h for the services that can be enabled here
// you can enable zero or more services
servo_init(PA_7);
// see jacdac-c/services/interfaces/jd_service_initializers.h for the services that can be
// enabled here you can enable zero or more services
servo_init(&servo_params);
}