handling missing i2c state

pull/2/head
Mateusz Lubecki 2020-04-28 00:31:43 +02:00
rodzic e9beb2be98
commit 6405a3d35a
4 zmienionych plików z 9 dodań i 4 usunięć

BIN
i2c_loop_error.jpg 100644

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 112 KiB

Wyświetl plik

@ -5,7 +5,7 @@
#include "drivers/serial.h"
#define SW_VER "DF00"
#define SW_DATE "13042020"
#define SW_DATE "28042020"
#define SYSTICK_TICKS_PER_SECONDS 100
#define SYSTICK_TICKS_PERIOD 10

Wyświetl plik

@ -149,8 +149,7 @@ static void message_callback(struct AX25Msg *msg) {
}
int
main(int argc, char* argv[]){
int main(int argc, char* argv[]){
// Send a greeting to the trace device (skipped on Release).
// trace_puts("Hello ARM World!");

Wyświetl plik

@ -146,7 +146,13 @@ void i2cVariableReset(void) {
}
void i2cIrqHandler(void) {
// int i;
if ((I2C1->SR1 & I2C_SR1_STOPF) == I2C_SR1_STOPF) {
I2C1->SR1 &= (0xFFFFFFFF ^ I2C_SR1_STOPF);
i2cStop();
i2c_state = I2C_ERROR;
}
if ((I2C1->SR1 & I2C_SR1_SB) == I2C_SR1_SB && (i2c_txing == 1 || i2c_rxing == 1)) {
// After Start conditions have been transmitted.
I2C1->DR = i2c_remote_addr; // Loading the slave address into data register