summaryrefslogtreecommitdiffstatshomepage
path: root/tests/ports/stm32/adcall.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ports/stm32/adcall.py')
-rw-r--r--tests/ports/stm32/adcall.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/ports/stm32/adcall.py b/tests/ports/stm32/adcall.py
index cfe179a97b..18896c40cb 100644
--- a/tests/ports/stm32/adcall.py
+++ b/tests/ports/stm32/adcall.py
@@ -1,5 +1,13 @@
+import sys
from pyb import Pin, ADCAll
+if "STM32WB" in sys.implementation._machine:
+ pa0_adc_channel = 5
+ skip_temp_test = True # temperature fails on WB55
+else:
+ pa0_adc_channel = 0
+ skip_temp_test = False
+
pins = [Pin.cpu.A0, Pin.cpu.A1, Pin.cpu.A2, Pin.cpu.A3]
# set pins to IN mode, init ADCAll, then check pins are ANALOG
@@ -12,7 +20,7 @@ for p in pins:
# set pins to IN mode, init ADCAll with mask, then check some pins are ANALOG
for p in pins:
p.init(p.IN)
-adc = ADCAll(12, 0x70003)
+adc = ADCAll(12, 0x70000 | 3 << pa0_adc_channel)
for p in pins:
print(p)
@@ -25,7 +33,11 @@ for c in range(19):
print(type(adc.read_channel(c)))
# call special reading functions
-print(0 < adc.read_core_temp() < 100)
+print(skip_temp_test or 0 < adc.read_core_temp() < 100)
print(0 < adc.read_core_vbat() < 4)
print(0 < adc.read_core_vref() < 2)
print(0 < adc.read_vref() < 4)
+
+if sys.implementation._build == "NUCLEO_WB55":
+ # Restore button pin settings.
+ Pin("SW", Pin.IN, Pin.PULL_UP)