Fix servo init in example
This commit is contained in:
Родитель
d6dcf29e4f
Коммит
9ea9fa001b
|
@ -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/`
|
||||
|
|
2
jacdac-c
2
jacdac-c
|
@ -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);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче