kopia lustrzana https://github.com/OpenRTX/OpenRTX
Removed I2C initialisation from GDx EEPROM driver, as the I2C bus is already initialised in platform_init() and the double initialisation made some radios freeze on the splash screen
rodzic
92e0abafa2
commit
5d0c7f3d9c
|
@ -29,19 +29,15 @@ static const uint8_t devAddr = 0xA0; /* EEPROM I2C address */
|
|||
|
||||
void AT24Cx_init()
|
||||
{
|
||||
gpio_setMode(I2C_SDA, OPEN_DRAIN);
|
||||
gpio_setMode(I2C_SCL, OPEN_DRAIN);
|
||||
gpio_setAlternateFunction(I2C_SDA, 3);
|
||||
gpio_setAlternateFunction(I2C_SCL, 3);
|
||||
|
||||
i2c0_init();
|
||||
/*
|
||||
* Nothing to do here, on GDx devices the I2C bus is initialised in
|
||||
* platform_init() before starting all the other modules.
|
||||
*/
|
||||
}
|
||||
|
||||
void AT24Cx_terminate()
|
||||
{
|
||||
i2c0_terminate();
|
||||
gpio_setMode(I2C_SDA, INPUT);
|
||||
gpio_setMode(I2C_SCL, INPUT);
|
||||
|
||||
}
|
||||
|
||||
void AT24Cx_readData(uint32_t addr, void* buf, size_t len)
|
||||
|
|
|
@ -105,6 +105,8 @@ void platform_terminate()
|
|||
adc0_terminate();
|
||||
pthread_mutex_destroy(&adc_mutex);
|
||||
|
||||
i2c0_terminate();
|
||||
|
||||
/* Finally, remove power supply */
|
||||
gpio_clearPin(PWR_SW);
|
||||
}
|
||||
|
|
|
@ -104,6 +104,8 @@ void platform_terminate()
|
|||
adc0_terminate();
|
||||
pthread_mutex_destroy(&adc_mutex);
|
||||
|
||||
i2c0_terminate();
|
||||
|
||||
/* Finally, remove power supply */
|
||||
gpio_clearPin(PWR_SW);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue