1
0
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:
david gauchard
2019-04-26 22:05:46 +02:00
committed by GitHub
parent 5dd780c571
commit cdb549572d
15 changed files with 65 additions and 52 deletions

View File

@ -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;
}