Browse Source

nrf: Rename MICROPY_PY_MACHINE_TIMER to MICROPY_PY_MACHINE_TIMER_NRF.

So that it doesn't clash with the extmod version.

Also make the default for this enabled, so that most boards do not need to
configure it.

Signed-off-by: Damien George <damien@micropython.org>
pull/9755/head
Damien George 2 years ago
parent
commit
e8f5cfe0e1
  1. 1
      ports/nrf/boards/actinius_icarus/mpconfigboard.h
  2. 1
      ports/nrf/boards/arduino_nano_33_ble_sense/mpconfigboard.h
  3. 1
      ports/nrf/boards/arduino_primo/mpconfigboard.h
  4. 1
      ports/nrf/boards/blueio_tag_evim/mpconfigboard.h
  5. 1
      ports/nrf/boards/dvk_bl652/mpconfigboard.h
  6. 1
      ports/nrf/boards/evk_nina_b1/mpconfigboard.h
  7. 1
      ports/nrf/boards/evk_nina_b3/mpconfigboard.h
  8. 1
      ports/nrf/boards/feather52/mpconfigboard.h
  9. 1
      ports/nrf/boards/ibk_blyst_nano/mpconfigboard.h
  10. 1
      ports/nrf/boards/idk_blyst_nano/mpconfigboard.h
  11. 1
      ports/nrf/boards/microbit/mpconfigboard.h
  12. 1
      ports/nrf/boards/nrf52840-mdk-usb-dongle/mpconfigboard.h
  13. 1
      ports/nrf/boards/particle_xenon/mpconfigboard.h
  14. 1
      ports/nrf/boards/pca10000/mpconfigboard.h
  15. 1
      ports/nrf/boards/pca10001/mpconfigboard.h
  16. 1
      ports/nrf/boards/pca10028/mpconfigboard.h
  17. 1
      ports/nrf/boards/pca10031/mpconfigboard.h
  18. 1
      ports/nrf/boards/pca10040/mpconfigboard.h
  19. 1
      ports/nrf/boards/pca10056/mpconfigboard.h
  20. 1
      ports/nrf/boards/pca10059/mpconfigboard.h
  21. 2
      ports/nrf/boards/pca10090/mpconfigboard.h
  22. 1
      ports/nrf/boards/wt51822_s4at/mpconfigboard.h
  23. 2
      ports/nrf/main.c
  24. 2
      ports/nrf/modules/machine/modmachine.c
  25. 4
      ports/nrf/modules/machine/timer.c
  26. 4
      ports/nrf/mpconfigport.h
  27. 2
      ports/nrf/nrfx_config.h

1
ports/nrf/boards/actinius_icarus/mpconfigboard.h

@ -33,7 +33,6 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_PWM (0)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (0)

1
ports/nrf/boards/arduino_nano_33_ble_sense/mpconfigboard.h

@ -16,7 +16,6 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_PWM (1)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)

1
ports/nrf/boards/arduino_primo/mpconfigboard.h

@ -34,7 +34,6 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_PWM (1)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)

1
ports/nrf/boards/blueio_tag_evim/mpconfigboard.h

@ -34,7 +34,6 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_PWM (1)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)

1
ports/nrf/boards/dvk_bl652/mpconfigboard.h

@ -31,7 +31,6 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_PWM (1)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)

1
ports/nrf/boards/evk_nina_b1/mpconfigboard.h

@ -32,7 +32,6 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)

1
ports/nrf/boards/evk_nina_b3/mpconfigboard.h

@ -48,7 +48,6 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_PWM (1)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)

1
ports/nrf/boards/feather52/mpconfigboard.h

@ -31,7 +31,6 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_PWM (1)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)

1
ports/nrf/boards/ibk_blyst_nano/mpconfigboard.h

@ -34,7 +34,6 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_PWM (1)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)

1
ports/nrf/boards/idk_blyst_nano/mpconfigboard.h

@ -34,7 +34,6 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_PWM (1)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)

1
ports/nrf/boards/microbit/mpconfigboard.h

@ -32,7 +32,6 @@
#define MICROPY_PY_MUSIC (1)
#define MICROPY_PY_MACHINE_SOFT_PWM (1)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)

1
ports/nrf/boards/nrf52840-mdk-usb-dongle/mpconfigboard.h

@ -31,7 +31,6 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_PWM (1)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)

1
ports/nrf/boards/particle_xenon/mpconfigboard.h

@ -31,7 +31,6 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_PWM (1)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)

1
ports/nrf/boards/pca10000/mpconfigboard.h

@ -30,7 +30,6 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_SPI (0)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (0)
#define MICROPY_PY_MACHINE_ADC (0)

1
ports/nrf/boards/pca10001/mpconfigboard.h

@ -30,7 +30,6 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_SPI (0)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)

1
ports/nrf/boards/pca10028/mpconfigboard.h

@ -30,7 +30,6 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)

1
ports/nrf/boards/pca10031/mpconfigboard.h

@ -30,7 +30,6 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)

1
ports/nrf/boards/pca10040/mpconfigboard.h

@ -31,7 +31,6 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_PWM (1)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)

1
ports/nrf/boards/pca10056/mpconfigboard.h

@ -31,7 +31,6 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_PWM (1)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)

1
ports/nrf/boards/pca10059/mpconfigboard.h

@ -31,7 +31,6 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_PWM (1)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)

2
ports/nrf/boards/pca10090/mpconfigboard.h

@ -33,7 +33,7 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_PWM (0)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (0)
#define MICROPY_PY_MACHINE_TIMER_NRF (0)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (0)

1
ports/nrf/boards/wt51822_s4at/mpconfigboard.h

@ -32,7 +32,6 @@
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)

2
ports/nrf/main.c

@ -156,7 +156,7 @@ soft_reset:
rtc_init0();
#endif
#if MICROPY_PY_MACHINE_TIMER
#if MICROPY_PY_MACHINE_TIMER_NRF
timer_init0();
#endif

2
ports/nrf/modules/machine/modmachine.c

@ -232,7 +232,7 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = {
#if MICROPY_PY_MACHINE_RTCOUNTER
{ MP_ROM_QSTR(MP_QSTR_RTCounter), MP_ROM_PTR(&machine_rtcounter_type) },
#endif
#if MICROPY_PY_MACHINE_TIMER
#if MICROPY_PY_MACHINE_TIMER_NRF
{ MP_ROM_QSTR(MP_QSTR_Timer), MP_ROM_PTR(&machine_timer_type) },
#endif
#if MICROPY_PY_MACHINE_HW_PWM

4
ports/nrf/modules/machine/timer.c

@ -29,7 +29,7 @@
#include "timer.h"
#include "nrfx_timer.h"
#if MICROPY_PY_MACHINE_TIMER
#if MICROPY_PY_MACHINE_TIMER_NRF
enum {
TIMER_MODE_ONESHOT,
@ -243,4 +243,4 @@ MP_DEFINE_CONST_OBJ_TYPE(
locals_dict, &machine_timer_locals_dict
);
#endif // MICROPY_PY_MACHINE_TIMER
#endif // MICROPY_PY_MACHINE_TIMER_NRF

4
ports/nrf/mpconfigport.h

@ -196,8 +196,8 @@
#define MICROPY_PY_MACHINE_SOFT_PWM (0)
#endif
#ifndef MICROPY_PY_MACHINE_TIMER
#define MICROPY_PY_MACHINE_TIMER (0)
#ifndef MICROPY_PY_MACHINE_TIMER_NRF
#define MICROPY_PY_MACHINE_TIMER_NRF (1)
#endif
#ifndef MICROPY_PY_MACHINE_RTCOUNTER

2
ports/nrf/nrfx_config.h

@ -132,7 +132,7 @@
#define NRFX_RTC1_ENABLED 1
#define NRFX_RTC2_ENABLED (!NRF51) && (!NRF9160_XXAA)
#define NRFX_TIMER_ENABLED (MICROPY_PY_MACHINE_TIMER)
#define NRFX_TIMER_ENABLED (MICROPY_PY_MACHINE_TIMER_NRF)
#define NRFX_TIMER0_ENABLED 1
#define NRFX_TIMER1_ENABLED (!MICROPY_PY_MACHINE_SOFT_PWM)
#define NRFX_TIMER2_ENABLED 1

Loading…
Cancel
Save