aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.cpp
blob: 2007c2f4bf2e6594cc4d0be80053d5cc8a9361d7 (plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "stm32f10x_map.h"
#include "stm32f10x_lib.h"
#include "stm32f10x_flash.h"
#include "stm32f10x_usart.h"
#include "Serial.h"
#include "timers.h"
#include "wiring.h"
#include "util.h"
#include "systick.h"
#include "adc.h"
#include "gpio.h"
#include "pwm.h"
#include "ext_interrupts.h"
#include "usart.h"

void setup();
void loop();

int ledPin = 13;

void setup()
{
//    Serial1.begin(9600);
//    Serial1.println("setup start");

//    pinMode(ledPin, OUTPUT);
    pinMode(1, GPIO_MODE_AF_OUTPUT_PP);
    pinMode(0, INPUT);

    pinMode(ledPin, OUTPUT);

//    usart_init(2);


//    Serial1.println("setup end");
}

int toggle = 0;

void loop() {
    toggle ^= 1;
    digitalWrite(ledPin, toggle);
    delay(100);
}


int main(void)
{
    init();
    setup();

    while (1) {
        loop();
    }
    return 0;
}


/* Implemented:
 * void pinMode(pin, mode) 
 * void digitalWrite(pin, value)
 * uint32_t digitalRead(pin)
 * uint32_t analogRead(pin)
 * void randomSeed(seed)
 * long random(max)
 * long random(min, max)
 * */