8000 restore proper arduino Client:: & Wire:: API by d-a-v · Pull Request #5969 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

restore proper arduino Client:: & Wire:: API #5969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f7a5337
restore proper arduino Client:: API
d-a-v Apr 9, 2019
dbf44bb
while we are at it: fixe Arduino wire api
d-a-v Apr 9, 2019
f28977f
Merge branch 'belovedArduinoAPI' of github.com:d-a-v/Arduino into bel…
d-a-v Apr 11, 2019
1ad9423
Merge branch 'master' into belovedArduinoAPI
d-a-v Apr 11, 2019
fa1988b
Merge branch 'master' into belovedArduinoAPI
earlephilhower Apr 12, 2019
bd81595
Merge branch 'master' into belovedArduinoAPI
d-a-v Apr 15, 2019
47b8f38
Merge branch 'master' into belovedArduinoAPI
d-a-v Apr 17, 2019
e19e7dc
Merge branch 'belovedArduinoAPI' of github.com:d-a-v/Arduino into bel…
d-a-v Apr 19, 2019
87d507e
replace old Ethernet library by a submodule ref'ing the updated one
d-a-v Apr 19, 2019
75bc43a
Merge branch 'master' into belovedArduinoAPI
d-a-v Apr 19, 2019
f7bafcc
Merge branch 'belovedArduinoAPI' of github.com:d-a-v/Arduino into bel…
d-a-v Apr 19, 2019
7065006
8000 wip for Ethernet
d-a-v Apr 19, 2019
8a1a283
fix unused variable in ethernet example
d-a-v Apr 19, 2019
6fb53fc
Merge branch 'master' into belovedArduinoAPI
d-a-v Apr 19, 2019
5a96968
fix for compatibility with lwIP-1.4
d-a-v Apr 20, 2019
c2384fc
Merge branch 'belovedArduinoAPI' of github.com:d-a-v/Arduino into bel…
d-a-v Apr 20, 2019
2a38bc4
restore old Ethernet (waiting for new Ethernet PR is accepted)
d-a-v Apr 25, 2019
dfa2273
Merge branch 'master' into belovedArduinoAPI
d-a-v Apr 25, 2019
68fe46a
remove submodule
d-a-v Apr 25, 2019
beef77d
Merge branch 'belovedArduinoAPI' of github.com:d-a-v/Arduino into bel…
d-a-v Apr 25, 2019
c555160
Merge branch 'master' into belovedArduinoAPI
d-a-v Apr 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
while we are at it: fixe Arduino wire api
  • Loading branch information
d-a-v committed Apr 9, 2019
commit dbf44bb73469fd45d98f0122cff1e053df5e7b77
7 changes: 7 additions & 0 deletions libraries/Wire/Wire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,13 @@ void TwoWire::onRequestService(void)
user_onRequest();
}

void TwoWire::onReceive( void (*function)(int) ) {
// arduino api compatibility fixer:
// really hope size parameter will not exceed 2^31 :)
static_assert(sizeof(int) == sizeof(size_t), "something is wrong in Arduino kingdom");
user_onReceive = reinterpret_cast<void(*)(size_t)>(function);
}

void TwoWire::onReceive( void (*function)(size_t) ) {
user_onReceive = function;
}
Expand Down
3 changes: 2 additions & 1 deletion libraries/Wire/Wire.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class TwoWire : public Stream
virtual int read(void);
virtual int peek(void);
virtual void flush(void);
void onReceive( void (*)(size_t) );
void onReceive( void (*)(int) ); // arduino api
void onReceive( void (*)(size_t) ); // legacy esp8266 backward compatibility
void onRequest( void (*)(void) );

inline size_t write(unsigned long n) { return write((uint8_t)n); }
Expand Down
0