Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Commit 9d1b04a

Browse files
committed
fixed PWM duty cycle
1 parent 2cd599b commit 9d1b04a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cores/arduino/pwm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void analogWrite(uint8 pin, uint16 passed_val)
6363
}
6464
else
6565
{
66-
uint16 duty_cycle = map(passed_val, 0, MaxRes_val, 0, 65535);
66+
uint16 duty_cycle = map(passed_val, 0, MaxRes_val, 65535, 0);
6767
timer_dev *dev = PIN_MAP[pin].timer_device;
6868
if (pin >= GPIO_PINS || dev == NULL || dev->type == TIMER_BASIC)
6969
{

variants/otto/otto.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ extern const stm32_pin_info PIN_MAP[GPIO_PINS] = {
230230
{GPIOC, 3, NULL, 0, AFx, NULL, ADCx}, // PC3: D74 / MOSI - - - - SPI2_MOSI
231231
// ESP8266 POWER (D75)
232232
{GPIOH, 13, NULL, 0, AFx, NULL, ADCx}, // PH13: D75 / WIFI_PWR - - - -
233-
// USB POWER ENABLE (D76 )
233+
// USB POWER ENABLE (D76)
234234
{GPIOK, 4, NULL, 0, AFx, NULL, ADCx}, // PK4: D76 / USB_PWR - - - -
235235
// LCD BACK LIGHT CONTROL (D77)
236236
{GPIOJ, 3, NULL, 0, AFx, NULL, ADCx}, // PJ3: D77 / LCD_BL - - - -

0 commit comments

Comments
 (0)