@@ -74,10 +74,8 @@ class TwoWire : public HardwareI2C {
74
74
#if SOC_I2C_SUPPORT_SLAVE
75
75
bool is_slave;
76
76
// 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;
81
79
static void onRequestService (uint8_t , void *);
82
80
static void onReceiveService (uint8_t , uint8_t *, size_t , bool , void *);
83
81
#endif /* SOC_I2C_SUPPORT_SLAVE */
@@ -115,8 +113,8 @@ class TwoWire : public HardwareI2C {
115
113
size_t requestFrom (uint8_t address, size_t len, bool stopBit) override ;
116
114
size_t requestFrom (uint8_t address, size_t len) override ;
117
115
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 ;
120
118
121
119
// call setPins() first, so that begin() can be called without arguments from libraries
122
120
bool setPins (int sda, int scl);
0 commit comments