mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-27 18:02:17 +03:00
restore proper arduino Client:: & Wire:: API (#5969)
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user