blob: 5c9ecfc0e9a4f2d7db3e723a5f23b8e6e1d0b9da (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#include "gpio.h"
#include "delay.h"
/* Main function. This gets executed from the interrupt vector defined above. */
int main()
{
/* Enable the GPIO port B. */
__IO gpio_port_t* port_b = enable_gpio(GPIO_PORT_B);
gpio_output_pin_t pin3 = set_gpio_pin_output(port_b, PIN_3);
gpio_output_pin_t pin1 = set_gpio_pin_output(port_b, PIN_1);
while(1) {
/* Set the GPIO pin to high. */
pin_on(pin3);
pin_off(pin1);
delay(65535);
delay(65535);
delay(65535);
delay(65535);
delay(65535);
delay(65535);
delay(65535);
delay(65535);
delay(65535);
delay(65535);
/* Set the GPIO pin to low. */
pin_off(pin3);
pin_on(pin1);
delay(65535);
delay(65535);
delay(65535);
delay(65535);
delay(65535);
delay(65535);
delay(65535);
delay(65535);
delay(65535);
delay(65535);
}
}
|