Skip to content

Commit 32dcbd3

Browse files
committed
[TARGET_STMF4] reorg hal
some test extensions
1 parent fb2ece3 commit 32dcbd3

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

libraries/tests/mbed/pwm/main.cpp

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,46 @@ int main() {
107107

108108
printf("Initialize PWM on pin PD_12 with duty cycle: %.2f\n", result);
109109

110+
notify_completion(result == value ? true : false);
111+
#elif defined(TARGET_MTS_MDOT_F405RG)
112+
PwmOut pwm_1(PA_0);
113+
114+
pwm_1.write(value);
115+
116+
float result = floor(pwm_1.read() * 100 + 0.5) / 100; // round it to 0.xx
117+
118+
printf("Initialize PWM on pin PD_12 with duty cycle: %.2f\n", result);
119+
120+
notify_completion(result == value ? true : false);
121+
#elif defined(TARGET_MTS_DRAGONFLY_F411RE)
122+
PwmOut pwm_1(PA_0);
123+
124+
pwm_1.write(value);
125+
126+
float result = floor(pwm_1.read() * 100 + 0.5) / 100; // round it to 0.xx
127+
128+
printf("Initialize PWM on pin PD_12 with duty cycle: %.2f\n", result);
129+
130+
notify_completion(result == value ? true : false);
131+
#elif defined(TARGET_MTS_MDOT_F411RE)
132+
PwmOut pwm_1(PA_0);
133+
134+
pwm_1.write(value);
135+
136+
float result = floor(pwm_1.read() * 100 + 0.5) / 100; // round it to 0.xx
137+
138+
printf("Initialize PWM on pin PD_12 with duty cycle: %.2f\n", result);
139+
140+
notify_completion(result == value ? true : false);
141+
#elif defined(TARGET_UBLOX_C029)
142+
PwmOut pwm_1(PA_0);
143+
144+
pwm_1.write(value);
145+
146+
float result = floor(pwm_1.read() * 100 + 0.5) / 100; // round it to 0.xx
147+
148+
printf("Initialize PWM on pin PD_12 with duty cycle: %.2f\n", result);
149+
110150
notify_completion(result == value ? true : false);
111151
#else
112152
#error This test is not supported on this target.

workspace_tools/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
"mcu": ["LPC1768", "LPC2368", "KL25Z", "K64F", "K22F", "LPC4088", "LPC1549",
137137
"NUCLEO_F072RB", "NUCLEO_F091RC", "NUCLEO_F302R8", "NUCLEO_F303RE",
138138
"NUCLEO_F334R8", "NUCLEO_L053R8", "NUCLEO_L073RZ", "NUCLEO_L152RE",
139-
"NUCLEO_F411RE","DISCO_F407VG"]
139+
"NUCLEO_F411RE","DISCO_F407VG","ARCH_MAX"]
140140
},
141141
{
142142
"id": "MBED_A9", "description": "Serial Echo at 115200",

0 commit comments

Comments
 (0)