@@ -74,10 +74,8 @@ class TwoWire : public HardwareI2C {
7474#if SOC_I2C_SUPPORT_SLAVE
7575 bool is_slave;
7676 // functional pointers for user callbacks
77- using user_onRequest_t = std::function<void ()>;
78- using user_onReceive_t = std::function<void (int )>;
79- user_onRequest_t user_onRequest;
80- user_onReceive_t user_onReceive;
77+ std::function<void ()> user_onRequest;
78+ std::function<void (int ) user_onReceive;
8179 static void onRequestService (uint8_t , void *);
8280 static void onReceiveService (uint8_t , uint8_t *, size_t , bool , void *);
8381#endif /* SOC_I2C_SUPPORT_SLAVE */
@@ -115,8 +113,8 @@ class TwoWire : public HardwareI2C {
115113 size_t requestFrom (uint8_t address, size_t len, bool stopBit) override ;
116114 size_t requestFrom (uint8_t address, size_t len) override ;
117115
118- void onReceive (user_onReceive_t ) override ;
119- void onRequest (user_onRequest_t ) override ;
116+ void onReceive (std::function< void ( int ) ) override ;
117+ void onRequest (std::function< void ()> ) override ;
120118
121119 // call setPins() first, so that begin() can be called without arguments from libraries
122120 bool setPins (int sda, int scl);
0 commit comments