1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-01 03:47:23 +03:00

Now appending main() to the user's sketch in preparation for making the Arduino core a library (.a) file.

This commit is contained in:
David A. Mellis
2007-01-12 17:58:39 +00:00
parent 2e1776862e
commit 41d50ae572
5 changed files with 37 additions and 26 deletions

12
targets/arduino/main.cxx Executable file
View File

@ -0,0 +1,12 @@
int main(void)
{
init();
setup();
for (;;)
loop();
return 0;
}

View File

@ -549,7 +549,7 @@ void shiftOut(int dataPin, int clockPin, int bitOrder, byte val) {
}
}
int main(void)
void init()
{
// this needs to be called before setup() or some functions won't
// work there
@ -626,11 +626,4 @@ int main(void)
#else
UCSRB = 0;
#endif
setup();
for (;;)
loop();
return 0;
}
}

View File

@ -66,6 +66,8 @@ extern "C"{
typedef uint8_t boolean;
typedef uint8_t byte;
void init(void);
void pinMode(int, int);
void digitalWrite(int, int);
int digitalRead(int);
@ -74,9 +76,9 @@ void analogWrite(int, int);
void beginSerial(long);
void serialWrite(unsigned char);
int serialAvailable();
int serialRead();
void serialFlush();
int serialAvailable(void);
int serialRead(void);
void serialFlush(void);
void printMode(int);
void printByte(unsigned char c);
void printNewline();