mirror of https://github.com/noisymime/Arduino.git
Merge branch 'new-extension' of https://github.com/arduino/Arduino into new-extension
Conflicts: build/linux/dist/tools/avrdude.conf
This commit is contained in:
commit
94879d3ac6
|
@ -176,14 +176,17 @@ public class AvrdudeUploader extends Uploader {
|
|||
|
||||
public boolean avrdude(Collection params) throws RunnerException {
|
||||
List commandDownloader = new ArrayList();
|
||||
commandDownloader.add("avrdude");
|
||||
|
||||
// Point avrdude at its config file since it's in a non-standard location.
|
||||
if (Base.isLinux()) {
|
||||
// ???: is it better to have Linux users install avrdude themselves, in
|
||||
// a way that it can find its own configuration file?
|
||||
commandDownloader.add("-C" + Base.getHardwarePath() + "/tools/avrdude.conf");
|
||||
} else {
|
||||
|
||||
if(Base.isLinux()) {
|
||||
if ((new File(Base.getHardwarePath() + "/tools/" + "avrdude")).exists()) {
|
||||
commandDownloader.add(Base.getHardwarePath() + "/tools/" + "avrdude");
|
||||
commandDownloader.add("-C" + Base.getHardwarePath() + "/tools/avrdude.conf");
|
||||
} else {
|
||||
commandDownloader.add("avrdude");
|
||||
}
|
||||
}
|
||||
else {
|
||||
commandDownloader.add(Base.getHardwarePath() + "/tools/avr/bin/" + "avrdude");
|
||||
commandDownloader.add("-C" + Base.getHardwarePath() + "/tools/avr/etc/avrdude.conf");
|
||||
}
|
||||
|
||||
|
|
|
@ -380,28 +380,60 @@ public class Compiler implements MessageConsumer {
|
|||
// }
|
||||
|
||||
if (pieces != null) {
|
||||
RunnerException e = sketch.placeException(pieces[3], pieces[1], PApplet.parseInt(pieces[2]) - 1);
|
||||
String error = pieces[3], msg = "";
|
||||
|
||||
if (pieces[3].trim().equals("SPI.h: No such file or directory")) {
|
||||
error = "Please import the SPI library from the Sketch > Import Library menu.";
|
||||
msg = "\nAs of Arduino 0019, the Ethernet library depends on the SPI library." +
|
||||
"\nYou appear to be using it or another library that depends on the SPI library.\n\n";
|
||||
}
|
||||
|
||||
if (pieces[3].trim().equals("'BYTE' was not declared in this scope")) {
|
||||
error = "The 'BYTE' keyword is no longer supported.";
|
||||
msg = "\nAs of Arduino 1.0, the 'BYTE' keyword is no longer supported." +
|
||||
"\nPlease use Serial.write() instead.\n\n";
|
||||
}
|
||||
|
||||
if (pieces[3].trim().equals("no matching function for call to 'Server::Server(int)'")) {
|
||||
error = "The Server class has been renamed EthernetServer.";
|
||||
msg = "\nAs of Arduino 1.0, the Server class in the Ethernet library " +
|
||||
"has been renamed to EthernetServer.\n\n";
|
||||
}
|
||||
|
||||
if (pieces[3].trim().equals("no matching function for call to 'Client::Client(byte [4], int)'")) {
|
||||
error = "The Client class has been renamed EthernetClient.";
|
||||
msg = "\nAs of Arduino 1.0, the Client class in the Ethernet library " +
|
||||
"has been renamed to EthernetClient.\n\n";
|
||||
}
|
||||
|
||||
if (pieces[3].trim().equals("'Udp' was not declared in this scope")) {
|
||||
error = "The Udp class has been renamed EthernetUdp.";
|
||||
msg = "\nAs of Arduino 1.0, the Udp class in the Ethernet library " +
|
||||
"has been renamed to EthernetClient.\n\n";
|
||||
}
|
||||
|
||||
if (pieces[3].trim().equals("'class TwoWire' has no member named 'send'")) {
|
||||
error = "Wire.send() has been renamed Wire.write().";
|
||||
msg = "\nAs of Arduino 1.0, the Wire.send() function was renamed " +
|
||||
"to Wire.write() for consistency with other libraries.\n\n";
|
||||
}
|
||||
|
||||
if (pieces[3].trim().equals("'class TwoWire' has no member named 'receive'")) {
|
||||
error = "Wire.receive() has been renamed Wire.read().";
|
||||
msg = "\nAs of Arduino 1.0, the Wire.receive() function was renamed " +
|
||||
"to Wire.read() for consistency with other libraries.\n\n";
|
||||
}
|
||||
|
||||
RunnerException e = sketch.placeException(error, pieces[1], PApplet.parseInt(pieces[2]) - 1);
|
||||
|
||||
// replace full file path with the name of the sketch tab (unless we're
|
||||
// in verbose mode, in which case don't modify the compiler output)
|
||||
if (e != null && !verbose) {
|
||||
SketchCode code = sketch.getCode(e.getCodeIndex());
|
||||
String fileName = code.isExtension(sketch.getDefaultExtension()) ? code.getPrettyName() : code.getFileName();
|
||||
s = fileName + ":" + e.getCodeLine() + ": error: " + e.getMessage();
|
||||
s = fileName + ":" + e.getCodeLine() + ": error: " + pieces[3] + msg;
|
||||
}
|
||||
|
||||
if (pieces[3].trim().equals("SPI.h: No such file or directory")) {
|
||||
e = new RunnerException("Please import the SPI library from the Sketch > Import Library menu.");
|
||||
s += "\nAs of Arduino 0019, the Ethernet library depends on the SPI library." +
|
||||
"\nYou appear to be using it or another library that depends on the SPI library.";
|
||||
}
|
||||
|
||||
if (pieces[3].trim().equals("'BYTE' was not declared in this scope")) {
|
||||
e = new RunnerException("The 'BYTE' keyword is no longer supported.");
|
||||
s += "\nAs of Arduino 1.0, the 'BYTE' keyword is no longer supported." +
|
||||
"\nPlease use Serial.write() instead.";
|
||||
}
|
||||
|
||||
|
||||
if (exception == null && e != null) {
|
||||
exception = e;
|
||||
exception.hideStackTrace();
|
||||
|
|
|
@ -114,17 +114,6 @@ public abstract class Uploader implements MessageConsumer {
|
|||
String[] commandArray = new String[commandDownloader.size()];
|
||||
commandDownloader.toArray(commandArray);
|
||||
|
||||
String avrBasePath;
|
||||
|
||||
if(Base.isLinux()) {
|
||||
avrBasePath = new String(Base.getHardwarePath() + "/tools/");
|
||||
}
|
||||
else {
|
||||
avrBasePath = new String(Base.getHardwarePath() + "/tools/avr/bin/");
|
||||
}
|
||||
|
||||
commandArray[0] = avrBasePath + commandArray[0];
|
||||
|
||||
if (verbose || Preferences.getBoolean("upload.verbose")) {
|
||||
for(int i = 0; i < commandArray.length; i++) {
|
||||
System.out.print(commandArray[i] + " ");
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -28,7 +28,7 @@ buttons.status.font = SansSerif,plain,12
|
|||
buttons.status.color = #ffffff
|
||||
|
||||
# GUI - LINESTATUS
|
||||
linestatus.color = #17A1A5
|
||||
linestatus.color = #ffffff
|
||||
linestatus.bgcolor = #006468
|
||||
|
||||
# EDITOR - DETAILS
|
||||
|
|
|
@ -10,7 +10,6 @@ public:
|
|||
virtual int connect(IPAddress ip, uint16_t port) =0;
|
||||
virtual int connect(const char *host, uint16_t port) =0;
|
||||
virtual size_t write(uint8_t) =0;
|
||||
virtual size_t write(const char *str) =0;
|
||||
virtual size_t write(const uint8_t *buf, size_t size) =0;
|
||||
virtual int available() = 0;
|
||||
virtual int read() = 0;
|
||||
|
|
|
@ -95,7 +95,6 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
|
|||
#else
|
||||
void serialEvent() __attribute__((weak));
|
||||
void serialEvent() {}
|
||||
volatile static unsigned char serialEvent_flag = 0;
|
||||
#define serialEvent_implemented
|
||||
#if defined(USART_RX_vect)
|
||||
SIGNAL(USART_RX_vect)
|
||||
|
@ -117,7 +116,6 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
|
|||
#error UDR not defined
|
||||
#endif
|
||||
store_char(c, &rx_buffer);
|
||||
serialEvent_flag = 1;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@ -125,13 +123,11 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
|
|||
#if defined(USART1_RX_vect)
|
||||
void serialEvent1() __attribute__((weak));
|
||||
void serialEvent1() {}
|
||||
volatile static unsigned char serialEvent1_flag = 0;
|
||||
#define serialEvent1_implemented
|
||||
SIGNAL(USART1_RX_vect)
|
||||
{
|
||||
unsigned char c = UDR1;
|
||||
store_char(c, &rx_buffer1);
|
||||
serialEvent1_flag = 1;
|
||||
}
|
||||
#elif defined(SIG_USART1_RECV)
|
||||
#error SIG_USART1_RECV
|
||||
|
@ -140,13 +136,11 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
|
|||
#if defined(USART2_RX_vect) && defined(UDR2)
|
||||
void serialEvent2() __attribute__((weak));
|
||||
void serialEvent2() {}
|
||||
volatile static unsigned char serialEvent2_flag = 0;
|
||||
#define serialEvent2_implemented
|
||||
SIGNAL(USART2_RX_vect)
|
||||
{
|
||||
unsigned char c = UDR2;
|
||||
store_char(c, &rx_buffer2);
|
||||
serialEvent2_flag = 1;
|
||||
}
|
||||
#elif defined(SIG_USART2_RECV)
|
||||
#error SIG_USART2_RECV
|
||||
|
@ -155,13 +149,11 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
|
|||
#if defined(USART3_RX_vect) && defined(UDR3)
|
||||
void serialEvent3() __attribute__((weak));
|
||||
void serialEvent3() {}
|
||||
volatile static unsigned char serialEvent3_flag = 0;
|
||||
#define serialEvent3_implemented
|
||||
SIGNAL(USART3_RX_vect)
|
||||
{
|
||||
unsigned char c = UDR3;
|
||||
store_char(c, &rx_buffer3);
|
||||
serialEvent3_flag = 1;
|
||||
}
|
||||
#elif defined(SIG_USART3_RECV)
|
||||
#error SIG_USART3_RECV
|
||||
|
@ -169,38 +161,17 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
|
|||
|
||||
void serialEventRun(void)
|
||||
{
|
||||
unsigned char flag, oldSREG;
|
||||
#ifdef serialEvent_implemented
|
||||
oldSREG = SREG;
|
||||
noInterrupts();
|
||||
flag = serialEvent_flag;
|
||||
serialEvent_flag = 0;
|
||||
SREG = oldSREG;
|
||||
if (flag) serialEvent();
|
||||
if (Serial.available()) serialEvent();
|
||||
#endif
|
||||
#ifdef serialEvent1_implemented
|
||||
oldSREG = SREG;
|
||||
noInterrupts();
|
||||
flag = serialEvent1_flag;
|
||||
serialEvent1_flag = 0;
|
||||
SREG = oldSREG;
|
||||
if (flag) serialEvent1();
|
||||
if (Serial1.available()) serialEvent1();
|
||||
#endif
|
||||
#ifdef serialEvent2_implemented
|
||||
oldSREG = SREG;
|
||||
noInterrupts();
|
||||
flag = serialEvent2_flag;
|
||||
serialEvent2_flag = 0;
|
||||
SREG = oldSREG;
|
||||
if (flag) serialEvent2();
|
||||
if (Serial2.available()) serialEvent2();
|
||||
#endif
|
||||
#ifdef serialEvent3_implemented
|
||||
oldSREG = SREG;
|
||||
noInterrupts();
|
||||
flag = serialEvent3_flag;
|
||||
serialEvent3_flag = 0;
|
||||
SREG = oldSREG;
|
||||
if (flag) serialEvent3();
|
||||
if (Serial3.available()) serialEvent3();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -75,6 +75,6 @@ class HardwareSerial : public Stream
|
|||
extern HardwareSerial Serial3;
|
||||
#endif
|
||||
|
||||
extern void serialEventRun(void);
|
||||
extern void serialEventRun(void) __attribute__((weak));
|
||||
|
||||
#endif
|
||||
|
|
|
@ -29,16 +29,6 @@
|
|||
|
||||
// Public Methods //////////////////////////////////////////////////////////////
|
||||
|
||||
/* default implementation: may be overridden */
|
||||
size_t Print::write(const char *str)
|
||||
{
|
||||
size_t n = 0;
|
||||
while (*str) {
|
||||
n += write(*str++);
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
/* default implementation: may be overridden */
|
||||
size_t Print::write(const uint8_t *buffer, size_t size)
|
||||
{
|
||||
|
|
|
@ -46,7 +46,7 @@ class Print
|
|||
void clearWriteError() { setWriteError(0); }
|
||||
|
||||
virtual size_t write(uint8_t) = 0;
|
||||
virtual size_t write(const char *str);
|
||||
size_t write(const char *str) { return write((const uint8_t *)str, strlen(str)); }
|
||||
virtual size_t write(const uint8_t *buffer, size_t size);
|
||||
|
||||
size_t print(const __FlashStringHelper *);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef server_h
|
||||
#define server_h
|
||||
|
||||
class Server {
|
||||
class Server : public Print {
|
||||
public:
|
||||
virtual void begin() =0;
|
||||
};
|
||||
|
|
|
@ -57,8 +57,6 @@ public:
|
|||
virtual int endPacket() =0;
|
||||
// Write a single byte into the packet
|
||||
virtual size_t write(uint8_t) =0;
|
||||
// Write a string of characters into the packet
|
||||
virtual size_t write(const char *str) =0;
|
||||
// Write size bytes from buffer into the packet
|
||||
virtual size_t write(const uint8_t *buffer, size_t size) =0;
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ int main(void)
|
|||
|
||||
for (;;) {
|
||||
loop();
|
||||
serialEventRun();
|
||||
if (serialEventRun) serialEventRun();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -74,10 +74,6 @@ size_t EthernetClient::write(uint8_t b) {
|
|||
return write(&b, 1);
|
||||
}
|
||||
|
||||
size_t EthernetClient::write(const char *str) {
|
||||
return write((const uint8_t *) str, strlen(str));
|
||||
}
|
||||
|
||||
size_t EthernetClient::write(const uint8_t *buf, size_t size) {
|
||||
if (_sock == MAX_SOCK_NUM) {
|
||||
setWriteError();
|
||||
|
|
|
@ -15,7 +15,6 @@ public:
|
|||
virtual int connect(IPAddress ip, uint16_t port);
|
||||
virtual int connect(const char *host, uint16_t port);
|
||||
virtual size_t write(uint8_t);
|
||||
virtual size_t write(const char *str);
|
||||
virtual size_t write(const uint8_t *buf, size_t size);
|
||||
virtual int available();
|
||||
virtual int read();
|
||||
|
@ -27,6 +26,8 @@ public:
|
|||
virtual operator bool();
|
||||
|
||||
friend class EthernetServer;
|
||||
|
||||
using Print::write;
|
||||
|
||||
private:
|
||||
static uint16_t _srcport;
|
||||
|
|
|
@ -72,11 +72,6 @@ size_t EthernetServer::write(uint8_t b)
|
|||
write(&b, 1);
|
||||
}
|
||||
|
||||
size_t EthernetServer::write(const char *str)
|
||||
{
|
||||
write((const uint8_t *)str, strlen(str));
|
||||
}
|
||||
|
||||
size_t EthernetServer::write(const uint8_t *buffer, size_t size)
|
||||
{
|
||||
size_t n = 0;
|
||||
|
|
|
@ -15,8 +15,8 @@ public:
|
|||
EthernetClient available();
|
||||
virtual void begin();
|
||||
virtual size_t write(uint8_t);
|
||||
virtual size_t write(const char *str);
|
||||
virtual size_t write(const uint8_t *buf, size_t size);
|
||||
using Print::write;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -107,12 +107,6 @@ size_t EthernetUDP::write(uint8_t byte)
|
|||
return write(&byte, 1);
|
||||
}
|
||||
|
||||
size_t EthernetUDP::write(const char *str)
|
||||
{
|
||||
size_t len = strlen(str);
|
||||
return write((const uint8_t *)str, len);
|
||||
}
|
||||
|
||||
size_t EthernetUDP::write(const uint8_t *buffer, size_t size)
|
||||
{
|
||||
uint16_t bytes_written = bufferData(_sock, _offset, buffer, size);
|
||||
|
|
|
@ -67,10 +67,10 @@ public:
|
|||
virtual int endPacket();
|
||||
// Write a single byte into the packet
|
||||
virtual size_t write(uint8_t);
|
||||
// Write a string of characters into the packet
|
||||
virtual size_t write(const char *str);
|
||||
// Write size bytes from buffer into the packet
|
||||
virtual size_t write(const uint8_t *buffer, size_t size);
|
||||
|
||||
using Print::write;
|
||||
|
||||
// Start processing the next available incoming packet
|
||||
// Returns the size of the packet in bytes, or 0 if no packets are available
|
||||
|
|
|
@ -81,6 +81,8 @@ public:
|
|||
void setCursor(uint8_t, uint8_t);
|
||||
virtual size_t write(uint8_t);
|
||||
void command(uint8_t);
|
||||
|
||||
using Print::write;
|
||||
private:
|
||||
void send(uint8_t, uint8_t);
|
||||
void write4bits(uint8_t);
|
||||
|
|
|
@ -62,10 +62,6 @@ size_t File::write(uint8_t val) {
|
|||
return write(&val, 1);
|
||||
}
|
||||
|
||||
size_t File::write(const char *str) {
|
||||
return write((const uint8_t *) str, strlen(str));
|
||||
}
|
||||
|
||||
size_t File::write(const uint8_t *buf, size_t size) {
|
||||
size_t t;
|
||||
if (!_file) {
|
||||
|
|
|
@ -33,7 +33,6 @@ public:
|
|||
File(void); // 'empty' constructor
|
||||
~File(void); // destructor
|
||||
virtual size_t write(uint8_t);
|
||||
virtual size_t write(const char *str);
|
||||
virtual size_t write(const uint8_t *buf, size_t size);
|
||||
virtual int read();
|
||||
virtual int peek();
|
||||
|
@ -50,6 +49,8 @@ public:
|
|||
boolean isDirectory(void);
|
||||
File openNextFile(uint8_t mode = O_RDONLY);
|
||||
void rewindDirectory(void);
|
||||
|
||||
using Print::write;
|
||||
};
|
||||
|
||||
class SDClass {
|
||||
|
|
|
@ -93,6 +93,8 @@ public:
|
|||
virtual int read();
|
||||
virtual int available();
|
||||
virtual void flush();
|
||||
|
||||
using Print::write;
|
||||
|
||||
// public only for easy access by interrupt handlers
|
||||
static inline void handle_interrupt();
|
||||
|
|
|
@ -164,14 +164,6 @@ size_t TwoWire::write(const uint8_t *data, size_t quantity)
|
|||
return quantity;
|
||||
}
|
||||
|
||||
// must be called in:
|
||||
// slave tx event callback
|
||||
// or after beginTransmission(address)
|
||||
size_t TwoWire::write(const char *data)
|
||||
{
|
||||
return write((uint8_t*)data, strlen(data));
|
||||
}
|
||||
|
||||
// must be called in:
|
||||
// slave rx event callback
|
||||
// or after requestFrom(address, numBytes)
|
||||
|
|
|
@ -53,7 +53,6 @@ class TwoWire : public Stream
|
|||
uint8_t requestFrom(uint8_t, uint8_t);
|
||||
uint8_t requestFrom(int, int);
|
||||
virtual size_t write(uint8_t);
|
||||
virtual size_t write(const char *);
|
||||
virtual size_t write(const uint8_t *, size_t);
|
||||
virtual int available(void);
|
||||
virtual int read(void);
|
||||
|
@ -61,6 +60,8 @@ class TwoWire : public Stream
|
|||
virtual void flush(void);
|
||||
void onReceive( void (*)(int) );
|
||||
void onRequest( void (*)(void) );
|
||||
|
||||
using Print::write;
|
||||
};
|
||||
|
||||
extern TwoWire Wire;
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
|
||||
#endif
|
||||
|
||||
#include "pins_arduino.h"
|
||||
#include "twi.h"
|
||||
|
||||
static volatile uint8_t twi_state;
|
||||
|
@ -63,18 +64,10 @@ void twi_init(void)
|
|||
{
|
||||
// initialize state
|
||||
twi_state = TWI_READY;
|
||||
|
||||
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega8__) || defined(__AVR_ATmega328P__)
|
||||
// activate internal pull-ups for twi
|
||||
// as per note from atmega8 manual pg167
|
||||
sbi(PORTC, 4);
|
||||
sbi(PORTC, 5);
|
||||
#else
|
||||
// activate internal pull-ups for twi
|
||||
// as per note from atmega128 manual pg204
|
||||
sbi(PORTD, 0);
|
||||
sbi(PORTD, 1);
|
||||
#endif
|
||||
|
||||
// activate internal pullups for twi.
|
||||
digitalWrite(SDA, 1);
|
||||
digitalWrite(SCL, 1);
|
||||
|
||||
// initialize twi prescaler and bit rate
|
||||
cbi(TWSR, TWPS0);
|
||||
|
|
Loading…
Reference in New Issue