aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32/f1
diff options
context:
space:
mode:
authorUwe Hermann2011-11-12 15:03:02 +0100
committerUwe Hermann2011-11-12 17:53:05 +0100
commitcd259c6eb3344eb96bdbd86c6ed8f6f91363f65d (patch)
treeb34e30331a8b644dadae779deed9a4fb533dc2c2 /examples/stm32/f1
parent61ff27cfbeee96c39d5c38400c47bfff111eab5b (diff)
other/adc_temperature_sensor: Cosmetics.
Diffstat (limited to 'examples/stm32/f1')
-rw-r--r--examples/stm32/f1/other/adc_temperature_sensor/README2
-rw-r--r--examples/stm32/f1/other/adc_temperature_sensor/adc.c12
2 files changed, 7 insertions, 7 deletions
diff --git a/examples/stm32/f1/other/adc_temperature_sensor/README b/examples/stm32/f1/other/adc_temperature_sensor/README
index aa00ef0..e17f8f8 100644
--- a/examples/stm32/f1/other/adc_temperature_sensor/README
+++ b/examples/stm32/f1/other/adc_temperature_sensor/README
@@ -3,7 +3,7 @@ README
------------------------------------------------------------------------------
This example program sends some characters on USART1.
-Afterwards it read out the internal temperature sensor of the STM32 and
+Afterwards it read out the internal temperature sensor of the STM32 and
sends the value read out from the ADC to the USART1.
The terminal settings for the receiving device/PC are 115200 8n1.
diff --git a/examples/stm32/f1/other/adc_temperature_sensor/adc.c b/examples/stm32/f1/other/adc_temperature_sensor/adc.c
index a87909c..4180e4e 100644
--- a/examples/stm32/f1/other/adc_temperature_sensor/adc.c
+++ b/examples/stm32/f1/other/adc_temperature_sensor/adc.c
@@ -63,7 +63,7 @@ void adc_setup(void)
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_ADC1EN);
- /* Make shure it doesn't run during config. */
+ /* Make sure the ADC doesn't run during config. */
adc_off(ADC1);
/* We configure everything for one single conversion. */
@@ -96,12 +96,12 @@ void my_usart_print_int(u32 usart, int value)
usart_send(usart, '-');
value = value * -1;
}
-
+
while (value > 0) {
buffer[nr_digits++] = "0123456789"[value % 10];
value /= 10;
}
-
+
for (i = nr_digits; i >= 0; i--)
usart_send(usart, buffer[i]);
}
@@ -129,16 +129,16 @@ int main(void)
/* Select the channel we want to convert. 16=temperature_sensor. */
channel_array[0] = 16;
adc_set_regular_sequence(ADC1, 1, channel_array);
-
+
/*
* If the ADC_CR2_ON bit is already set -> setting it another time
* starts the conversion.
*/
adc_on(ADC1);
-
+
/* Wait for end of conversion. */
while (!(ADC_SR(ADC1) & ADC_SR_EOC));
-
+
temperature = ADC_DR(ADC1);
/*