Skip to content

Commit a4afbc9

Browse files
committed
Remove dead code
1 parent 6b41c19 commit a4afbc9

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

cores/nRF5/wiring_analog_nRF52.c

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -273,48 +273,6 @@ uint32_t analogRead( uint32_t ulPin )
273273
return mapResolution(value, resolution, readResolution);
274274
}
275275

276-
#if 0
277-
// Right now, PWM output only works on the pins with
278-
// hardware support. These are defined in the appropriate
279-
// pins_*.c file. For the rest of the pins, we default
280-
// to digital output.
281-
void analogWrite( uint32_t ulPin, uint32_t ulValue )
282-
{
283-
if (ulPin >= PINS_COUNT) {
284-
return;
285-
}
286-
287-
ulPin = g_ADigitalPinMap[ulPin];
288-
289-
for (int i = 0; i < PWM_COUNT; i++) {
290-
if (pwmChannelPins[i] == 0xFFFFFFFF || pwmChannelPins[i] == ulPin) {
291-
pwmChannelPins[i] = ulPin;
292-
pwmChannelSequence[i] = bit(15) | ulValue;
293-
294-
NRF_PWM_Type* pwm = pwms[i];
295-
296-
pwm->PSEL.OUT[0] = ulPin;
297-
pwm->PSEL.OUT[1] = ulPin;
298-
pwm->PSEL.OUT[2] = ulPin;
299-
pwm->PSEL.OUT[3] = ulPin;
300-
pwm->ENABLE = (PWM_ENABLE_ENABLE_Enabled << PWM_ENABLE_ENABLE_Pos);
301-
pwm->PRESCALER = PWM_PRESCALER_PRESCALER_DIV_1;
302-
pwm->MODE = PWM_MODE_UPDOWN_Up;
303-
pwm->COUNTERTOP = (1 << writeResolution) - 1;
304-
pwm->LOOP = 0;
305-
pwm->DECODER = ((uint32_t)PWM_DECODER_LOAD_Common << PWM_DECODER_LOAD_Pos) | ((uint32_t)PWM_DECODER_MODE_RefreshCount << PWM_DECODER_MODE_Pos);
306-
pwm->SEQ[0].PTR = (uint32_t)&pwmChannelSequence[i];
307-
pwm->SEQ[0].CNT = 1;
308-
pwm->SEQ[0].REFRESH = 1;
309-
pwm->SEQ[0].ENDDELAY = 0;
310-
pwm->TASKS_SEQSTART[0] = 0x1UL;
311-
312-
break;
313-
}
314-
}
315-
}
316-
#endif
317-
318276
#ifdef __cplusplus
319277
}
320278
#endif

0 commit comments

Comments
 (0)