File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change 2424
2525#include <rtdevice.h>
2626
27- static struct rt_mutex i2c_core_lock ;
28-
2927rt_err_t rt_i2c_bus_device_register (struct rt_i2c_bus_device * bus ,
3028 const char * bus_name )
3129{
3230 rt_err_t res = RT_EOK ;
3331
3432 rt_mutex_init (& bus -> lock , "i2c_bus_lock" , RT_IPC_FLAG_FIFO );
3533
36- rt_mutex_take (& i2c_core_lock , RT_WAITING_FOREVER );
37-
38- if (bus -> timeout == 0 )
39- bus -> timeout = RT_TICK_PER_SECOND ;
34+ if (bus -> timeout == 0 ) bus -> timeout = RT_TICK_PER_SECOND ;
4035
4136 res = rt_i2c_bus_device_device_init (bus , bus_name );
4237
4338 i2c_dbg ("I2C bus [%s] registered\n" , bus_name );
4439
45- rt_mutex_release (& i2c_core_lock );
46-
4740 return res ;
4841}
4942
@@ -136,6 +129,6 @@ rt_size_t rt_i2c_master_recv(struct rt_i2c_bus_device *bus,
136129
137130int rt_i2c_core_init (void )
138131{
139- return rt_mutex_init ( & i2c_core_lock , "i2c_core_lock" , RT_IPC_FLAG_FIFO ) ;
132+ return 0 ;
140133}
141134INIT_COMPONENT_EXPORT (rt_i2c_core_init );
You can’t perform that action at this time.
0 commit comments