1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

Allow variants to define an initVariant() function that is called at startup.

See #2080 and #2139.
This commit is contained in:
Matthijs Kooijman 2014-06-25 15:58:38 +02:00
parent 4eb686673f
commit 4014dd6070
2 changed files with 8 additions and 0 deletions

View File

@ -118,6 +118,7 @@ typedef uint8_t boolean;
typedef uint8_t byte;
void init(void);
void initVariant(void);
void pinMode(uint8_t, uint8_t);
void digitalWrite(uint8_t, uint8_t);

View File

@ -19,10 +19,17 @@
#include <Arduino.h>
// Weak empty variant initialization function.
// May be redefined by variant files.
void initVariant() __attribute__((weak));
void initVariant() { }
int main(void)
{
init();
initVariant();
#if defined(USBCON)
USBDevice.attach();
#endif