mirror of
https://github.com/esp8266/Arduino.git
synced 2025-10-15 11:26:40 +03:00
Merge branch 'ide-1.5.x' into can
This commit is contained in:
@@ -43,6 +43,7 @@ int DhcpClass::request_DHCP_lease(){
|
||||
_dhcpTransactionId = random(1UL, 2000UL);
|
||||
_dhcpInitialTransactionId = _dhcpTransactionId;
|
||||
|
||||
_dhcpUdpSocket.stop();
|
||||
if (_dhcpUdpSocket.begin(DHCP_CLIENT_PORT) == 0)
|
||||
{
|
||||
// Couldn't get a socket
|
||||
|
@@ -10,7 +10,9 @@ uint16_t EthernetClass::_server_port[MAX_SOCK_NUM] = {
|
||||
|
||||
int EthernetClass::begin(uint8_t *mac_address)
|
||||
{
|
||||
_dhcp = new DhcpClass();
|
||||
static DhcpClass s_dhcp;
|
||||
_dhcp = &s_dhcp;
|
||||
|
||||
|
||||
// Initialise the basic info
|
||||
W5100.init();
|
||||
@@ -59,7 +61,6 @@ void EthernetClass::begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dn
|
||||
void EthernetClass::begin(uint8_t *mac, IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet)
|
||||
{
|
||||
W5100.init();
|
||||
|
||||
W5100.setMACAddress(mac);
|
||||
W5100.setIPAddress(local_ip._address);
|
||||
W5100.setGatewayIp(gateway._address);
|
||||
|
@@ -63,7 +63,7 @@ void loop() {
|
||||
// send a standard http response header
|
||||
client.println("HTTP/1.1 200 OK");
|
||||
client.println("Content-Type: text/html");
|
||||
client.println("Connnection: close");
|
||||
client.println("Connection: close");
|
||||
client.println();
|
||||
client.println("<!DOCTYPE HTML>");
|
||||
client.println("<html>");
|
||||
|
@@ -63,15 +63,15 @@ void mousePressed() {
|
||||
// This function intercepts mouse button release
|
||||
void mouseReleased() {
|
||||
Serial.print("Released: ");
|
||||
if (!mouse.getButton(LEFT_BUTTON) && left==true) {
|
||||
if (!mouse.getButton(LEFT_BUTTON) && leftButton == true) {
|
||||
Serial.print("L");
|
||||
leftButton = false;
|
||||
}
|
||||
if (!mouse.getButton(MIDDLE_BUTTON) && middle==true) {
|
||||
if (!mouse.getButton(MIDDLE_BUTTON) && middleButton == true) {
|
||||
Serial.print("M");
|
||||
middleButton = false;
|
||||
}
|
||||
if (!mouse.getButton(RIGHT_BUTTON) && right==true) {
|
||||
if (!mouse.getButton(RIGHT_BUTTON) && rightButton == true) {
|
||||
Serial.print("R");
|
||||
rightButton = false;
|
||||
}
|
||||
|
@@ -76,7 +76,7 @@ void loop() {
|
||||
// send a standard http response header
|
||||
client.println("HTTP/1.1 200 OK");
|
||||
client.println("Content-Type: text/html");
|
||||
client.println("Connnection: close");
|
||||
client.println("Connection: close");
|
||||
client.println();
|
||||
client.println("<!DOCTYPE HTML>");
|
||||
client.println("<html>");
|
||||
|
@@ -15,16 +15,11 @@ extern "C" {
|
||||
#define SLAVEREADY 7 // handshake pin
|
||||
#define WIFILED 9 // led on wifi shield
|
||||
|
||||
#define DELAY_100NS do { asm volatile("nop"); }while(0);
|
||||
#define DELAY_SPI(X) { int ii=0; do { asm volatile("nop"); }while(++ii<X);}
|
||||
#define DELAY_SPI(X) { int ii=0; do { asm volatile("nop"); } while (++ii < X*6); }
|
||||
#define DELAY_TRANSFER() DELAY_SPI(10)
|
||||
|
||||
void SpiDrv::begin()
|
||||
{
|
||||
// pinMode(SCK, OUTPUT);
|
||||
// pinMode(MOSI, OUTPUT);
|
||||
// pinMode(SS, OUTPUT);
|
||||
|
||||
SPI.begin();
|
||||
pinMode(SLAVESELECT, OUTPUT);
|
||||
pinMode(SLAVEREADY, INPUT);
|
||||
@@ -69,11 +64,6 @@ void SpiDrv::spiSlaveDeselect()
|
||||
char SpiDrv::spiTransfer(volatile char data)
|
||||
{
|
||||
char result = SPI.transfer(data);
|
||||
// SPDR = data; // Start the transmission
|
||||
// while (!(SPSR & (1<<SPIF))) // Wait the end of the transmission
|
||||
// {
|
||||
// };
|
||||
// char result = SPDR;
|
||||
DELAY_TRANSFER();
|
||||
|
||||
return result; // return the received byte
|
||||
|
Reference in New Issue
Block a user