1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-20 14:54:31 +01:00

Elaborate configuration of which pins to use: support HOODLOADER2 and old Uno style wiring.

This commit is contained in:
Peter Van Hoyweghen 2015-08-30 20:27:38 +02:00
parent 13cc57ed7e
commit e3866e0ef5

View File

@ -46,12 +46,7 @@
#include "Arduino.h"
#undef SERIAL
// Use pin 10 to reset the target
#define RESET 10
#define LED_HB 9
#define LED_ERR 8
#define LED_PMODE 7
#define PROG_FLICKER true
// Configure SPI clock.
@ -75,6 +70,44 @@
#endif
// Configure which pins to use
// The standard pin configuration.
#ifndef ARDUINO_HOODLOADER2
#define RESET 10 // Use pin 10 to reset the target rather than SS
#define LED_HB 9
#define LED_ERR 8
#define LED_PMODE 7
// Uncomment following line to use the old uno style wiring
// (using pin 11, 12 and 13 instead of the SPI header) on Leonardo, Due...
// #define USE_OLD_STYLE_WIRING
#ifdef USE_OLD_STYLE_WIRING
#undef USE_HARDWARE_SPI
#undef MOSI
#undef MISO
#undef SCK
#define MOSI 11
#define MISO 12
#define SCK 13
#endif
// HOODLOADER2 means running sketches on the atmega16u2
// serial converter chips on Uno or Mega boards.
// We must use pins that are broken out:
#else
#define RESET 4
#define LED_HB 7
#define LED_ERR 6
#define LED_PMODE 5
#endif
// Configure the serial port to use.
//
// Prefer the USB virtual serial port (aka. native USB port), if the Arduino has one: