[nucleo-f411re] Stylefix.
This commit is contained in:
@@ -26,14 +26,14 @@ static void gpio_setup(void)
|
|||||||
{
|
{
|
||||||
/* Enable GPIOA clock. */
|
/* Enable GPIOA clock. */
|
||||||
/* Manually: */
|
/* Manually: */
|
||||||
// RCC_AHB1ENR |= RCC_AHB1ENR_IOPAEN;
|
/*RCC_AHB1ENR |= RCC_AHB1ENR_IOPAEN; */
|
||||||
/* Using API functions: */
|
/* Using API functions: */
|
||||||
rcc_periph_clock_enable(RCC_GPIOA);
|
rcc_periph_clock_enable(RCC_GPIOA);
|
||||||
|
|
||||||
/* Set GPIO5 (in GPIO port A) to 'output push-pull'. */
|
/* Set GPIO5 (in GPIO port A) to 'output push-pull'. */
|
||||||
/* Manually: */
|
/* Manually: */
|
||||||
// GPIOA_CRH = (GPIO_CNF_OUTPUT_PUSHPULL << (((8 - 8) * 4) + 2));
|
/*GPIOA_CRH = (GPIO_CNF_OUTPUT_PUSHPULL << (((8 - 8) * 4) + 2)); */
|
||||||
// GPIOA_CRH |= (GPIO_MODE_OUTPUT_2_MHZ << ((8 - 8) * 4));
|
/*GPIOA_CRH |= (GPIO_MODE_OUTPUT_2_MHZ << ((8 - 8) * 4)); */
|
||||||
/* Using API functions: */
|
/* Using API functions: */
|
||||||
gpio_mode_setup(GPIOA, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO5);
|
gpio_mode_setup(GPIOA, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO5);
|
||||||
}
|
}
|
||||||
@@ -47,20 +47,20 @@ int main(void)
|
|||||||
/* Blink the LED (PC8) on the board. */
|
/* Blink the LED (PC8) on the board. */
|
||||||
while (1) {
|
while (1) {
|
||||||
/* Manually: */
|
/* Manually: */
|
||||||
// GPIOA_BSRR = GPIO5; /* LED off */
|
/* GPIOA_BSRR = GPIO5; */ /* LED off */
|
||||||
// for (i = 0; i < 1000000; i++) /* Wait a bit. */
|
/* for (i = 0; i < 1000000; i++) */ /* Wait a bit. */
|
||||||
// __asm__("nop");
|
/* __asm__("nop"); */
|
||||||
// GPIOA_BRR = GPIO5; /* LED on */
|
/* GPIOA_BRR = GPIO5; */ /* LED on */
|
||||||
// for (i = 0; i < 1000000; i++) /* Wait a bit. */
|
/* for (i = 0; i < 1000000; i++) */ /* Wait a bit. */
|
||||||
// __asm__("nop");
|
/* __asm__("nop"); */
|
||||||
|
|
||||||
/* Using API functions gpio_set()/gpio_clear(): */
|
/* Using API functions gpio_set()/gpio_clear(): */
|
||||||
// gpio_set(GPIOA, GPIO5); /* LED off */
|
/* gpio_set(GPIOA, GPIO5); */ /* LED off */
|
||||||
// for (i = 0; i < 1000000; i++) /* Wait a bit. */
|
/* for (i = 0; i < 1000000; i++) */ /* Wait a bit. */
|
||||||
// __asm__("nop");
|
/* __asm__("nop"); */
|
||||||
// gpio_clear(GPIOA, GPIO5); /* LED on */
|
/* gpio_clear(GPIOA, GPIO5); */ /* LED on */
|
||||||
// for (i = 0; i < 1000000; i++) /* Wait a bit. */
|
/* for (i = 0; i < 1000000; i++) */ /* Wait a bit. */
|
||||||
// __asm__("nop");
|
/* __asm__("nop"); */
|
||||||
|
|
||||||
/* Using API function gpio_toggle(): */
|
/* Using API function gpio_toggle(): */
|
||||||
gpio_toggle(GPIOA, GPIO5); /* LED on/off */
|
gpio_toggle(GPIOA, GPIO5); /* LED on/off */
|
||||||
|
|||||||
Reference in New Issue
Block a user