1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Merge remote-tracking branch 'origin/ide-1.5.x' into ide-1.5.x

This commit is contained in:
Fede85
2013-10-10 20:59:01 +02:00
324 changed files with 79374 additions and 30612 deletions

View File

0
libraries/Bridge/examples/TemperatureWebPanel/www/zepto.min.js vendored Executable file → Normal file
View File

View File

@ -13,6 +13,8 @@ Console KEYWORD3
Process KEYWORD3
Mailbox KEYWORD3
HttpClient KEYWORD3
YunServer KEYWORD3
YunClient KEYWORD3
#######################################
# Methods and Functions (KEYWORD2)

View File

@ -158,11 +158,11 @@ uint16_t BridgeClass::transfer(const uint8_t *buff1, uint16_t len1,
crcUpdate(index);
// Recv len
int lh = timedRead(5);
int lh = timedRead(10);
if (lh < 0)
continue;
crcUpdate(lh);
int ll = timedRead(5);
int ll = timedRead(10);
if (ll < 0)
continue;
crcUpdate(ll);

View File

@ -81,7 +81,12 @@ public:
}
void begin() {
serial.begin(250000);
serial.begin(250000); // for Yun
BridgeClass::begin();
}
void begin(int baudrate) {
serial.begin(baudrate); // for other linux-systems
BridgeClass::begin();
}

View File

@ -116,10 +116,10 @@ void File::doBuffer() {
if (buffered > 0)
return;
// Try to buffer up to 32 characters
// Try to buffer up to BUFFER_SIZE characters
readPos = 0;
uint8_t cmd[] = {'G', handle, sizeof(buffer)};
buffered = bridge.transfer(cmd, 3, buffer, sizeof(buffer)) - 1;
uint8_t cmd[] = {'G', handle, BUFFER_SIZE - 1};
buffered = bridge.transfer(cmd, 3, buffer, BUFFER_SIZE) - 1;
//err = buff[0]; // First byte is error code
if (buffered>0) {
// Shift the reminder of buffer

View File

@ -256,7 +256,7 @@ uint16_t recvfrom(SOCKET s, uint8_t *buf, uint16_t len, uint8_t *addr, uint16_t
switch (W5100.readSnMR(s) & 0x07)
{
case SnMR::UDP :
W5100.read_data(s, (uint8_t *)ptr, head, 0x08);
W5100.read_data(s, ptr, head, 0x08);
ptr += 8;
// read peer's IP address, port number.
addr[0] = head[0];
@ -268,14 +268,14 @@ uint16_t recvfrom(SOCKET s, uint8_t *buf, uint16_t len, uint8_t *addr, uint16_t
data_len = head[6];
data_len = (data_len << 8) + head[7];
W5100.read_data(s, (uint8_t *)ptr, buf, data_len); // data copy.
W5100.read_data(s, ptr, buf, data_len); // data copy.
ptr += data_len;
W5100.writeSnRX_RD(s, ptr);
break;
case SnMR::IPRAW :
W5100.read_data(s, (uint8_t *)ptr, head, 0x06);
W5100.read_data(s, ptr, head, 0x06);
ptr += 6;
addr[0] = head[0];
@ -285,19 +285,19 @@ uint16_t recvfrom(SOCKET s, uint8_t *buf, uint16_t len, uint8_t *addr, uint16_t
data_len = head[4];
data_len = (data_len << 8) + head[5];
W5100.read_data(s, (uint8_t *)ptr, buf, data_len); // data copy.
W5100.read_data(s, ptr, buf, data_len); // data copy.
ptr += data_len;
W5100.writeSnRX_RD(s, ptr);
break;
case SnMR::MACRAW:
W5100.read_data(s,(uint8_t*)ptr,head,2);
W5100.read_data(s, ptr, head, 2);
ptr+=2;
data_len = head[0];
data_len = (data_len<<8) + head[1] - 2;
W5100.read_data(s,(uint8_t*) ptr,buf,data_len);
W5100.read_data(s, ptr, buf, data_len);
ptr += data_len;
W5100.writeSnRX_RD(s, ptr);
break;
@ -310,6 +310,12 @@ uint16_t recvfrom(SOCKET s, uint8_t *buf, uint16_t len, uint8_t *addr, uint16_t
return data_len;
}
/**
* @brief Wait for buffered transmission to complete.
*/
void flush(SOCKET s) {
// TODO
}
uint16_t igmpsend(SOCKET s, const uint8_t * buf, uint16_t len)
{

View File

@ -98,7 +98,7 @@ void W5100Class::recv_data_processing(SOCKET s, uint8_t *data, uint16_t len, uin
{
uint16_t ptr;
ptr = readSnRX_RD(s);
read_data(s, (uint8_t *)ptr, data, len);
read_data(s, ptr, data, len);
if (!peek)
{
ptr += len;
@ -106,13 +106,13 @@ void W5100Class::recv_data_processing(SOCKET s, uint8_t *data, uint16_t len, uin
}
}
void W5100Class::read_data(SOCKET s, volatile uint8_t *src, volatile uint8_t *dst, uint16_t len)
void W5100Class::read_data(SOCKET s, volatile uint16_t src, volatile uint8_t *dst, uint16_t len)
{
uint16_t size;
uint16_t src_mask;
uint16_t src_ptr;
src_mask = (uint16_t)src & RMASK;
src_mask = src & RMASK;
src_ptr = RBASE[s] + src_mask;
if( (src_mask + len) > RSIZE )

View File

@ -138,7 +138,7 @@ public:
* the data from Receive buffer. Here also take care of the condition while it exceed
* the Rx memory uper-bound of socket.
*/
void read_data(SOCKET s, volatile uint8_t * src, volatile uint8_t * dst, uint16_t len);
void read_data(SOCKET s, volatile uint16_t src, volatile uint8_t * dst, uint16_t len);
/**
* @brief This function is being called by send() and sendto() function also.

View File

@ -310,6 +310,12 @@ uint16_t recvfrom(SOCKET s, uint8_t *buf, uint16_t len, uint8_t *addr, uint16_t
return data_len;
}
/**
* @brief Wait for buffered transmission to complete.
*/
void flush(SOCKET s) {
// TODO
}
uint16_t igmpsend(SOCKET s, const uint8_t * buf, uint16_t len)
{

View File

@ -120,8 +120,7 @@ int EthernetClient::peek() {
}
void EthernetClient::flush() {
while (available())
read();
::flush(_sock);
}
void EthernetClient::stop() {

View File

@ -13,6 +13,7 @@ extern int16_t recv(SOCKET s, uint8_t * buf, int16_t len); // Receive data (TCP)
extern uint16_t peek(SOCKET s, uint8_t *buf);
extern uint16_t sendto(SOCKET s, const uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t port); // Send data (UDP/IP RAW)
extern uint16_t recvfrom(SOCKET s, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t *port); // Receive data (UDP/IP RAW)
extern void flush(SOCKET s); // Wait for transmission to complete
extern uint16_t igmpsend(SOCKET s, const uint8_t * buf, uint16_t len);

View File

View File

0
libraries/Firmata/examples/EchoString/EchoString.ino Executable file → Normal file
View File

View File

View File

View File

View File

0
libraries/Firmata/examples/StandardFirmata/LICENSE.txt Executable file → Normal file
View File

View File

0
libraries/Firmata/extras/readme.md Executable file → Normal file
View File

0
libraries/Firmata/keywords.txt Executable file → Normal file
View File

0
libraries/Firmata/src/Boards.h Executable file → Normal file
View File

0
libraries/Firmata/src/Firmata.cpp Executable file → Normal file
View File

0
libraries/Firmata/src/Firmata.h Executable file → Normal file
View File

View File

@ -11,15 +11,13 @@
#include "SPI_Class.h"
SPIClass::SPIClass(Spi *_spi, uint32_t _id, void(*_initCb)(void)) :
spi(_spi), id(_id), initCb(_initCb)
spi(_spi), id(_id), initCb(_initCb), initialized(false)
{
// Empty
}
void SPIClass::begin() {
initCb();
SPI_Configure(spi, id, SPI_MR_MSTR | SPI_MR_PS | SPI_MR_MODFDIS);
SPI_Enable(spi);
init();
// NPCS control is left to the user
@ -30,9 +28,7 @@ void SPIClass::begin() {
}
void SPIClass::begin(uint8_t _pin) {
initCb();
SPI_Configure(spi, id, SPI_MR_MSTR | SPI_MR_PS | SPI_MR_MODFDIS);
SPI_Enable(spi);
init();
uint32_t spiPin = BOARD_PIN_TO_SPI_PIN(_pin);
PIO_Configure(
@ -47,6 +43,15 @@ void SPIClass::begin(uint8_t _pin) {
setBitOrder(_pin, MSBFIRST);
}
void SPIClass::init() {
if (initialized)
return;
initCb();
SPI_Configure(spi, id, SPI_MR_MSTR | SPI_MR_PS | SPI_MR_MODFDIS);
SPI_Enable(spi);
initialized = true;
}
void SPIClass::end(uint8_t _pin) {
uint32_t spiPin = BOARD_PIN_TO_SPI_PIN(_pin);
// Setting the pin as INPUT will disconnect it from SPI peripheral
@ -55,6 +60,7 @@ void SPIClass::end(uint8_t _pin) {
void SPIClass::end() {
SPI_Disable(spi);
initialized = false;
}
void SPIClass::setBitOrder(uint8_t _pin, BitOrder _bitOrder) {

View File

@ -54,12 +54,15 @@ class SPIClass {
void setClockDivider(uint8_t _div) { setClockDivider(BOARD_SPI_DEFAULT_SS, _div); };
private:
void init();
Spi *spi;
uint32_t id;
BitOrder bitOrder[SPI_CHANNELS_NUM];
uint32_t divider[SPI_CHANNELS_NUM];
uint32_t mode[SPI_CHANNELS_NUM];
void (*initCb)(void);
bool initialized;
};
#if SPI_INTERFACES_COUNT > 0

0
libraries/TFT/src/utility/Adafruit_ST7735.cpp Executable file → Normal file
View File

0
libraries/TFT/src/utility/Adafruit_ST7735.h Executable file → Normal file
View File

View File

@ -1,7 +0,0 @@
This is the most reliable library to control the USB host chip MAX3421E. It is used to handle the communication between the Arduino ADK board and Android devices supporting Accessory mode. It of course works with other devices, but documenting that is outside our scope.
It is of course based in the original by CircuitsAtHome.com and has been patched by Follower (RancidBacon.com)
CircuitsAtHome has discontinued the development of this project. The Arduino Team commissioned a patch to the library to make it reliable up to a 99%.
CircuitsAtHome revision of the code can be found at https://github.com/felis/USB_Host_Shield_2.0. However the Arduino Team does not recommend using that library, yet, with ADK compatible boards, as v1 is much more stable.

0
libraries/WiFi/arch/avr/WiFiClient.cpp Executable file → Normal file
View File

0
libraries/WiFi/arch/sam/WiFiClient.cpp Executable file → Normal file
View File

View File

0
libraries/WiFi/src/WiFi.cpp Executable file → Normal file
View File

0
libraries/WiFi/src/WiFi.h Executable file → Normal file
View File

0
libraries/WiFi/src/WiFiClient.h Executable file → Normal file
View File

0
libraries/WiFi/src/WiFiServer.h Executable file → Normal file
View File