Skip to content

Commit 4093c50

Browse files
committed
[DNM]pwm test patch
1 parent 2da6c44 commit 4093c50

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

samples/basic/blinky_pwm/src/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#define PWM_FLAGS 0
2828
#endif
2929

30-
#define MIN_PERIOD_USEC (USEC_PER_SEC / 128U)
30+
#define MIN_PERIOD_USEC (USEC_PER_SEC / 10240)
3131
#define MAX_PERIOD_USEC USEC_PER_SEC
3232

3333
void main(void)
@@ -58,6 +58,7 @@ void main(void)
5858
while (pwm_pin_set_usec(pwm, PWM_CHANNEL,
5959
max_period, max_period / 2U, PWM_FLAGS)) {
6060
max_period /= 2U;
61+
printk("INFO: Try PWM period %u\n", max_period);
6162
if (max_period < (4U * MIN_PERIOD_USEC)) {
6263
printk("Error: PWM device "
6364
"does not support a period at least %u\n",

samples/basic/fade_led/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* threshold. The steps should also be small enough, and happen
3333
* quickly enough, to make the output fade change appear continuous.
3434
*/
35-
#define PERIOD_USEC 20000U
35+
#define PERIOD_USEC 200U
3636
#define NUM_STEPS 50U
3737
#define STEP_USEC (PERIOD_USEC / NUM_STEPS)
3838
#define SLEEP_MSEC 25U

0 commit comments

Comments
 (0)