@@ -273,48 +273,6 @@ uint32_t analogRead( uint32_t ulPin )
273
273
return mapResolution (value , resolution , readResolution );
274
274
}
275
275
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
-
318
276
#ifdef __cplusplus
319
277
}
320
278
#endif
0 commit comments