Skip to content

Commit 2b79d8f

Browse files
committed
adding PWM to board.c for external WDT
1 parent 9376004 commit 2b79d8f

File tree

1 file changed

+6
-0
lines changed
  • ports/atmel-samd/boards/pycubed

1 file changed

+6
-0
lines changed

ports/atmel-samd/boards/pycubed/board.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
#include "boards/board.h"
3131
#include "py/mpconfig.h"
3232
#include "shared-bindings/nvm/ByteArray.h"
33+
#include "common-hal/microcontroller/Pin.h"
34+
#include "hal/include/hal_gpio.h"
35+
#include "shared-bindings/pulseio/PWMOut.h"
3336

3437
nvm_bytearray_obj_t bootcnt = {
3538
.base = {
@@ -41,6 +44,9 @@ nvm_bytearray_obj_t bootcnt = {
4144

4245

4346
void board_init(void) {
47+
pulseio_pwmout_obj_t pwm;
48+
common_hal_pulseio_pwmout_construct(&pwm, &pin_PA23, 4096, 2, false);
49+
common_hal_pulseio_pwmout_never_reset(&pwm);
4450
}
4551

4652
bool board_requests_safe_mode(void) {

0 commit comments

Comments
 (0)