mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
Diff: targets/hal/TARGET_STM/TARGET_NUCLEO_F302R8/analogout_api.c
- Revision:
- 135:067cc8ba23da
- Parent:
- 125:23cc3068a9e4
- Child:
- 159:3b23f6d9ecb9
diff -r 4fb64af58963 -r 067cc8ba23da targets/hal/TARGET_STM/TARGET_NUCLEO_F302R8/analogout_api.c --- a/targets/hal/TARGET_STM/TARGET_NUCLEO_F302R8/analogout_api.c Tue Mar 25 09:30:07 2014 +0000 +++ b/targets/hal/TARGET_STM/TARGET_NUCLEO_F302R8/analogout_api.c Tue Mar 25 10:15:07 2014 +0000 @@ -63,7 +63,7 @@ RCC_APB1PeriphClockCmd(RCC_APB1Periph_DAC, ENABLE); // Configure and enable DAC channel - DAC_StructInit(&DAC_InitStructure); + DAC_StructInit(&DAC_InitStructure); DAC_Init(dac, DAC_Channel_1, &DAC_InitStructure); DAC_Cmd(dac, DAC_Channel_1, ENABLE); @@ -95,10 +95,9 @@ void analogout_write_u16(dac_t *obj, uint16_t value) { if (value > (uint16_t)RANGE_12BIT) { - dac_write(obj, (uint16_t)RANGE_12BIT); // Max value - } - else { - dac_write(obj, value); + dac_write(obj, (uint16_t)RANGE_12BIT); // Max value + } else { + dac_write(obj, value); } }