mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
sync with arduino avr src
This commit is contained in:
parent
d6f62943d4
commit
af4f2d5e28
@ -195,6 +195,7 @@ unsigned long micros(void);
|
|||||||
void delay(unsigned long);
|
void delay(unsigned long);
|
||||||
void delayMicroseconds(unsigned int us);
|
void delayMicroseconds(unsigned int us);
|
||||||
unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout);
|
unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout);
|
||||||
|
unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout);
|
||||||
|
|
||||||
void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val);
|
void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val);
|
||||||
uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder);
|
uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder);
|
||||||
@ -243,6 +244,7 @@ uint16_t makeWord(byte h, byte l);
|
|||||||
#define word(...) makeWord(__VA_ARGS__)
|
#define word(...) makeWord(__VA_ARGS__)
|
||||||
|
|
||||||
unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);
|
unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);
|
||||||
|
unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);
|
||||||
|
|
||||||
void tone(uint8_t _pin, unsigned int frequency, unsigned long duration = 0);
|
void tone(uint8_t _pin, unsigned int frequency, unsigned long duration = 0);
|
||||||
void noTone(uint8_t _pin);
|
void noTone(uint8_t _pin);
|
||||||
@ -250,7 +252,7 @@ void noTone(uint8_t _pin);
|
|||||||
// WMath prototypes
|
// WMath prototypes
|
||||||
long random(long);
|
long random(long);
|
||||||
long random(long, long);
|
long random(long, long);
|
||||||
void randomSeed(unsigned int);
|
void randomSeed(unsigned long);
|
||||||
long map(long, long, long, long, long);
|
long map(long, long, long, long, long);
|
||||||
|
|
||||||
|
|
||||||
|
@ -127,8 +127,7 @@ size_t ICACHE_FLASH_ATTR Print::print(const Printable& x) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t ICACHE_FLASH_ATTR Print::println(void) {
|
size_t ICACHE_FLASH_ATTR Print::println(void) {
|
||||||
size_t n = print("\r\n");
|
return print("\r\n");
|
||||||
return n;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t ICACHE_FLASH_ATTR Print::println(const String &s) {
|
size_t ICACHE_FLASH_ATTR Print::println(const String &s) {
|
||||||
|
@ -69,6 +69,8 @@ class Stream: public Print {
|
|||||||
}
|
}
|
||||||
// returns true if target string is found, false if timed out
|
// returns true if target string is found, false if timed out
|
||||||
|
|
||||||
|
bool find(char target) { return find (&target, 1); }
|
||||||
|
|
||||||
bool findUntil(const char *target, const char *terminator); // as find but search ends if the terminator string is found
|
bool findUntil(const char *target, const char *terminator); // as find but search ends if the terminator string is found
|
||||||
bool findUntil(const uint8_t *target, const char *terminator) {
|
bool findUntil(const uint8_t *target, const char *terminator) {
|
||||||
return findUntil((char *) target, terminator);
|
return findUntil((char *) target, terminator);
|
||||||
|
@ -27,7 +27,7 @@ extern "C" {
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
}
|
}
|
||||||
|
|
||||||
void randomSeed(unsigned int seed) {
|
void randomSeed(unsigned long seed) {
|
||||||
if(seed != 0) {
|
if(seed != 0) {
|
||||||
srand(seed);
|
srand(seed);
|
||||||
}
|
}
|
||||||
|
@ -30,3 +30,7 @@ unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout) {
|
|||||||
while(digitalRead(pin) == state && (micros() - start) < timeout);
|
while(digitalRead(pin) == state && (micros() - start) < timeout);
|
||||||
return micros() - start;
|
return micros() - start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout) {
|
||||||
|
return pulseIn(pin, state, timeout);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user