Created
May 28, 2025 02:52
-
-
Save drashna/e9b6dd56458071fafe1468aa672a816a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef I2C_DRIVER | |
# define I2C_DRIVER I2CD1 | |
#endif | |
// ... | |
if (io_expander_ready()) { | |
// If we managed to initialize the mcp23018 - we need to reinitialize the matrix / layer state. During an electric discharge the i2c peripherals might be in a weird state. Giving a delay and resetting the MCU allows to recover from this. | |
mcp23018_reset_loop = 0; | |
mcp23018_errors = 0; | |
i2cStop(I2C_DRIVER); | |
wait_ms(10); | |
#ifdef RGB_MATRIX_ENABLE | |
rgb_matrix_init(); | |
#endif | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment