nrf5/modules/machine: Reserving timer0 instance for bluetooth if compiled in. Leaving timer1 and timer2 for application. Note that music module soft-pwm will also occupy timer1 if enabled.
This commit is contained in:
parent
6ddaba532a
commit
c28e94b534
|
@ -113,6 +113,13 @@ STATIC mp_obj_t machine_timer_make_new(const mp_obj_type_t *type, size_t n_args,
|
||||||
// get static peripheral object
|
// get static peripheral object
|
||||||
int timer_id = timer_find(args[0].u_obj);
|
int timer_id = timer_find(args[0].u_obj);
|
||||||
|
|
||||||
|
#if BLUETOOTH_SD
|
||||||
|
if (timer_id == 0) {
|
||||||
|
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError,
|
||||||
|
"Timer(%d) reserved by Bluetooth LE stack.", timer_id));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if MICROPY_PY_MACHINE_SOFT_PWM
|
#if MICROPY_PY_MACHINE_SOFT_PWM
|
||||||
if (timer_id == 1) {
|
if (timer_id == 1) {
|
||||||
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError,
|
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError,
|
||||||
|
|
Loading…
Reference in New Issue