diff --git a/mlx90640/MLX90640_I2C_Driver.c b/mlx90640/MLX90640_I2C_Driver.c index 8e97506..2387db5 100644 --- a/mlx90640/MLX90640_I2C_Driver.c +++ b/mlx90640/MLX90640_I2C_Driver.c @@ -33,7 +33,7 @@ int MLX90640_I2CRead(uint8_t slaveAddr, uint16_t startAddress, uint16_t nMemAddr int ack = 0; int cnt = 0; - ack = HAL_I2C_Mem_Read(&hi2c2, (slaveAddr<<1), startAddress, I2C_MEMADD_SIZE_16BIT, bp, nMemAddressRead*2, 500); + ack = HAL_I2C_Mem_Read(&hi2c2, (slaveAddr<<1), startAddress, I2C_MEMADD_SIZE_16BIT, bp, nMemAddressRead*2, 50); if (ack != HAL_OK) { @@ -64,7 +64,7 @@ int MLX90640_I2CWrite(uint8_t slaveAddr, uint16_t writeAddress, uint16_t data) cmd[0] = data >> 8; cmd[1] = data & 0x00FF; - ack = HAL_I2C_Mem_Write(&hi2c2, sa, writeAddress, I2C_MEMADD_SIZE_16BIT, cmd, sizeof(cmd), 500); + ack = HAL_I2C_Mem_Write(&hi2c2, sa, writeAddress, I2C_MEMADD_SIZE_16BIT, cmd, sizeof(cmd), 50); if (ack != HAL_OK) { diff --git a/mlx90640/mlx90640_lcd_display.c b/mlx90640/mlx90640_lcd_display.c index 33d6e4e..d5a345d 100644 --- a/mlx90640/mlx90640_lcd_display.c +++ b/mlx90640/mlx90640_lcd_display.c @@ -142,7 +142,7 @@ static void drawMeasurement(void ) { static void drawPicture(void) { for (y=0; y<24; y++) { for (x=0; x<32; x++) { - BSP_LCD_FillRect(x*10, y*11, 9, 11, TempToColor(tempValues[(x) + (y*32)])); + BSP_LCD_FillRect(x*10, y*11, 10, 11, TempToColor(tempValues[(x) + (y*32)])); } } } @@ -167,22 +167,14 @@ static void readTempValues(void) { MLX90640_CalculateTo(mlx90640Frame, &mlx90640, EMMISIVITY, tr, tempValues); } -#if 0 - APP_LOG(TS_OFF,VLEVEL_L, "\r\n\n\n"); - for (uint8_t y=0; y < 24; y++) { - for (uint8_t x=0; x<32; x++) { - APP_LOG(TS_OFF, VLEVEL_L, "%c ", (uint8_t)((((float)tempValues[y*32+x]- 25.0)) + 0x30)); - } - APP_LOG(TS_OFF,VLEVEL_L, "\r\n"); - } -#endif + } void mlx90640_display_process(void){ //APP_LOG(TS_OFF, VLEVEL_L, "Read value.\r\n"); readTempValues(); - setTempScale(); - drawPicture(); + setTempScale(); + drawPicture(); drawMeasurement(); } diff --git a/mlx90640/stm32_hx8347d_lcd.c b/mlx90640/stm32_hx8347d_lcd.c index 7985a95..97af836 100644 --- a/mlx90640/stm32_hx8347d_lcd.c +++ b/mlx90640/stm32_hx8347d_lcd.c @@ -1140,6 +1140,7 @@ static void SPIx_Write(uint8_t Value) HAL_StatusTypeDef status = HAL_OK; uint8_t data; + status = HAL_SPI_TransmitReceive(&hspi1, (uint8_t*) &Value, &data, 1, SpixTimeout); /* Check the communication status */