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:
parent
4eb686673f
commit
4014dd6070
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user