9393#error "ADC_CLOCK_DIV could not be defined"
9494#endif
9595
96+ #ifndef ADC_REGULAR_RANK_1
9697#define ADC_REGULAR_RANK_1 1
98+ #endif
9799/**
98100 * @}
99101 */
@@ -255,6 +257,8 @@ void HAL_DAC_MspInit(DAC_HandleTypeDef *hdac)
255257{
256258 GPIO_InitTypeDef GPIO_InitStruct ;
257259 GPIO_TypeDef * port ;
260+ UNUSED (hdac );
261+
258262 /*##-1- Enable peripherals and GPIO Clocks #################################*/
259263 /* Enable GPIO clock ****************************************/
260264 port = set_GPIO_Port_Clock (STM_PORT (g_current_pin ));
@@ -290,7 +294,7 @@ void dac_write_value(PinName pin, uint32_t value, uint8_t do_init)
290294 uint32_t dacChannel ;
291295
292296 DacHandle .Instance = pinmap_peripheral (pin , PinMap_DAC );
293- if (DacHandle .Instance == NC ) return ;
297+ if (DacHandle .Instance == NP ) return ;
294298 dacChannel = get_dac_channel (pin );
295299 if (!IS_DAC_CHANNEL (dacChannel )) return ;
296300 if (do_init == 1 ) {
@@ -338,6 +342,7 @@ void dac_write_value(PinName pin, uint32_t value, uint8_t do_init)
338342 */
339343void HAL_DAC_MspDeInit (DAC_HandleTypeDef * hdac )
340344{
345+ UNUSED (hdac );
341346 /* DAC Periph clock disable */
342347#ifdef __HAL_RCC_DAC1_CLK_DISABLE
343348 __HAL_RCC_DAC1_CLK_DISABLE ();
@@ -359,7 +364,7 @@ void dac_stop(PinName pin)
359364 uint32_t dacChannel ;
360365
361366 DacHandle .Instance = pinmap_peripheral (pin , PinMap_DAC );
362- if (DacHandle .Instance == NC ) return ;
367+ if (DacHandle .Instance == NP ) return ;
363368 dacChannel = get_dac_channel (pin );
364369 if (!IS_DAC_CHANNEL (dacChannel )) return ;
365370
@@ -550,7 +555,7 @@ uint16_t adc_read_value(PinName pin)
550555
551556 AdcHandle .Instance = pinmap_peripheral (pin , PinMap_ADC );
552557
553- if (AdcHandle .Instance == NC ) return 0 ;
558+ if (AdcHandle .Instance == NP ) return 0 ;
554559
555560 AdcHandle .Init .ClockPrescaler = ADC_CLOCK_DIV ; /* Asynchronous clock mode, input ADC clock divided */
556561 AdcHandle .Init .Resolution = ADC_RESOLUTION_12B ; /* 12-bit resolution for converted data */
@@ -717,7 +722,7 @@ void pwm_start(PinName pin, uint32_t clock_freq,
717722
718723 /* Compute the prescaler value to have TIM counter clock equal to clock_freq Hz */
719724 timHandle .Instance = pinmap_peripheral (pin , PinMap_PWM );
720- if (timHandle .Instance == NC ) return 0 ;
725+ if (timHandle .Instance == NP ) return ;
721726 timHandle .Init .Prescaler = (uint32_t )(getTimerClkFreq (timHandle .Instance ) / clock_freq ) - 1 ;
722727 timHandle .Init .Period = period - 1 ;
723728 timHandle .Init .ClockDivision = TIM_CLOCKDIVISION_DIV1 ;
@@ -778,9 +783,9 @@ void pwm_stop(PinName pin)
778783 uint32_t timChannel ;
779784
780785 timHandle .Instance = pinmap_peripheral (pin , PinMap_PWM );
781- if (timHandle .Instance == NC ) return 0 ;
786+ if (timHandle .Instance == NP ) return ;
782787 timChannel = get_pwm_channel (pin );
783- if (!IS_TIM_CHANNELS (timChannel )) return 0 ;
788+ if (!IS_TIM_CHANNELS (timChannel )) return ;
784789
785790#ifndef STM32L0xx
786791 if (STM_PIN_INVERTED (pinmap_function (pin , PinMap_PWM ))) {
0 commit comments