1
0
Fork 0

Tidy up existing i2c_master implementations (#15376)

* Move chibios defines out of header

* Make some avr defines internal
This commit is contained in:
Joel Challis 2021-12-02 14:32:31 +00:00 committed by GitHub
parent 4466261895
commit 3bf2403244
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 71 additions and 81 deletions

View file

@ -53,25 +53,6 @@ bool led_update_kb(led_t led_state) {
return res;
}
// override the default implementation to avoid re-initialization
void i2c_init(void)
{
static bool initialized = false;
if (initialized) {
return;
} else {
initialized = true;
}
// Try releasing special pins for a short time
palSetLineMode(I2C1_SCL_PIN, PAL_MODE_INPUT);
palSetLineMode(I2C1_SDA_PIN, PAL_MODE_INPUT);
chThdSleepMilliseconds(10);
palSetLineMode(I2C1_SCL_PIN, PAL_MODE_ALTERNATE(I2C1_SCL_PAL_MODE) | PAL_STM32_OTYPE_OPENDRAIN);
palSetLineMode(I2C1_SDA_PIN, PAL_MODE_ALTERNATE(I2C1_SDA_PAL_MODE) | PAL_STM32_OTYPE_OPENDRAIN);
}
#define REBOOT_MAGIC 0x41544B42
void shutdown_user(void)
{