Cleanup I2C and drivers
This commit is contained in:
@@ -46,6 +46,8 @@ void reboot();
|
|||||||
//If the user has programmed in a bootup logo, draw it to the screen from flash
|
//If the user has programmed in a bootup logo, draw it to the screen from flash
|
||||||
//Returns 1 if the logo was printed so that the unit waits for the timeout or button
|
//Returns 1 if the logo was printed so that the unit waits for the timeout or button
|
||||||
uint8_t showBootLogoIfavailable();
|
uint8_t showBootLogoIfavailable();
|
||||||
|
|
||||||
|
void delay_ms(uint16_t count);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -250,3 +250,7 @@ void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c __unused) {
|
|||||||
void reboot() {
|
void reboot() {
|
||||||
NVIC_SystemReset();
|
NVIC_SystemReset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void delay_ms(uint16_t count) {
|
||||||
|
HAL_Delay(count);
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,25 +6,25 @@
|
|||||||
*/
|
*/
|
||||||
#include <I2C_Wrapper.hpp>
|
#include <I2C_Wrapper.hpp>
|
||||||
#include "BSP.h"
|
#include "BSP.h"
|
||||||
|
#include "Setup.h"
|
||||||
#define I2CUSESDMA
|
#define I2CUSESDMA
|
||||||
I2C_HandleTypeDef *FRToSI2C::i2c;
|
|
||||||
SemaphoreHandle_t FRToSI2C::I2CSemaphore;
|
SemaphoreHandle_t FRToSI2C::I2CSemaphore;
|
||||||
StaticSemaphore_t FRToSI2C::xSemaphoreBuffer;
|
StaticSemaphore_t FRToSI2C::xSemaphoreBuffer;
|
||||||
|
|
||||||
void FRToSI2C::CpltCallback() {
|
void FRToSI2C::CpltCallback() {
|
||||||
i2c->State = HAL_I2C_STATE_READY; // Force state reset (even if tx error)
|
hi2c1.State = HAL_I2C_STATE_READY; // Force state reset (even if tx error)
|
||||||
if (I2CSemaphore) {
|
if (I2CSemaphore) {
|
||||||
xSemaphoreGiveFromISR(I2CSemaphore, NULL);
|
xSemaphoreGiveFromISR(I2CSemaphore, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FRToSI2C::Mem_Read(uint16_t DevAddress, uint16_t MemAddress,
|
bool FRToSI2C::Mem_Read(uint16_t DevAddress, uint16_t MemAddress,
|
||||||
uint16_t MemAddSize, uint8_t *pData, uint16_t Size) {
|
uint8_t *pData, uint16_t Size) {
|
||||||
|
|
||||||
if (I2CSemaphore == NULL) {
|
if (I2CSemaphore == NULL) {
|
||||||
// no RToS, run blocking code
|
// no RToS, run blocking code
|
||||||
HAL_I2C_Mem_Read(i2c, DevAddress, MemAddress, MemAddSize, pData, Size,
|
HAL_I2C_Mem_Read(&hi2c1, DevAddress, MemAddress, I2C_MEMADD_SIZE_8BIT,
|
||||||
5000);
|
pData, Size, 5000);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// RToS is active, run threading
|
// RToS is active, run threading
|
||||||
@@ -32,10 +32,10 @@ bool FRToSI2C::Mem_Read(uint16_t DevAddress, uint16_t MemAddress,
|
|||||||
// Wait up to 1 second for the mutex
|
// Wait up to 1 second for the mutex
|
||||||
if (xSemaphoreTake(I2CSemaphore, (TickType_t)50) == pdTRUE) {
|
if (xSemaphoreTake(I2CSemaphore, (TickType_t)50) == pdTRUE) {
|
||||||
#ifdef I2CUSESDMA
|
#ifdef I2CUSESDMA
|
||||||
if (HAL_I2C_Mem_Read(i2c, DevAddress, MemAddress, MemAddSize, pData,
|
if (HAL_I2C_Mem_Read(&hi2c1, DevAddress, MemAddress,
|
||||||
Size, 500) != HAL_OK) {
|
I2C_MEMADD_SIZE_8BIT, pData, Size, 500) != HAL_OK) {
|
||||||
|
|
||||||
I2C1_ClearBusyFlagErratum();
|
I2C_Unstick();
|
||||||
xSemaphoreGive(I2CSemaphore);
|
xSemaphoreGive(I2CSemaphore);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@@ -44,7 +44,7 @@ bool FRToSI2C::Mem_Read(uint16_t DevAddress, uint16_t MemAddress,
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
if (HAL_I2C_Mem_Read(i2c, DevAddress, MemAddress, MemAddSize, pData, Size,
|
if (HAL_I2C_Mem_Read(&hi2c1, DevAddress, MemAddress, I2C_MEMADD_SIZE_8BIT, pData, Size,
|
||||||
5000)==HAL_OK){
|
5000)==HAL_OK){
|
||||||
xSemaphoreGive(I2CSemaphore);
|
xSemaphoreGive(I2CSemaphore);
|
||||||
return true;
|
return true;
|
||||||
@@ -59,36 +59,36 @@ bool FRToSI2C::Mem_Read(uint16_t DevAddress, uint16_t MemAddress,
|
|||||||
|
|
||||||
}
|
}
|
||||||
void FRToSI2C::I2C_RegisterWrite(uint8_t address, uint8_t reg, uint8_t data) {
|
void FRToSI2C::I2C_RegisterWrite(uint8_t address, uint8_t reg, uint8_t data) {
|
||||||
Mem_Write(address, reg, I2C_MEMADD_SIZE_8BIT, &data, 1);
|
Mem_Write(address, reg, &data, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t FRToSI2C::I2C_RegisterRead(uint8_t add, uint8_t reg) {
|
uint8_t FRToSI2C::I2C_RegisterRead(uint8_t add, uint8_t reg) {
|
||||||
uint8_t tx_data[1];
|
uint8_t tx_data[1];
|
||||||
Mem_Read(add, reg, I2C_MEMADD_SIZE_8BIT, tx_data, 1);
|
Mem_Read(add, reg, tx_data, 1);
|
||||||
return tx_data[0];
|
return tx_data[0];
|
||||||
}
|
}
|
||||||
void FRToSI2C::Mem_Write(uint16_t DevAddress, uint16_t MemAddress,
|
void FRToSI2C::Mem_Write(uint16_t DevAddress, uint16_t MemAddress,
|
||||||
uint16_t MemAddSize, uint8_t *pData, uint16_t Size) {
|
uint8_t *pData, uint16_t Size) {
|
||||||
|
|
||||||
if (I2CSemaphore == NULL) {
|
if (I2CSemaphore == NULL) {
|
||||||
// no RToS, run blocking code
|
// no RToS, run blocking code
|
||||||
HAL_I2C_Mem_Write(i2c, DevAddress, MemAddress, MemAddSize, pData, Size,
|
HAL_I2C_Mem_Write(&hi2c1, DevAddress, MemAddress, I2C_MEMADD_SIZE_8BIT,
|
||||||
5000);
|
pData, Size, 5000);
|
||||||
} else {
|
} else {
|
||||||
// RToS is active, run threading
|
// RToS is active, run threading
|
||||||
// Get the mutex so we can use the I2C port
|
// Get the mutex so we can use the I2C port
|
||||||
// Wait up to 1 second for the mutex
|
// Wait up to 1 second for the mutex
|
||||||
if (xSemaphoreTake(I2CSemaphore, (TickType_t)50) == pdTRUE) {
|
if (xSemaphoreTake(I2CSemaphore, (TickType_t)50) == pdTRUE) {
|
||||||
#ifdef I2CUSESDMA
|
#ifdef I2CUSESDMA
|
||||||
if (HAL_I2C_Mem_Write(i2c, DevAddress, MemAddress, MemAddSize,
|
if (HAL_I2C_Mem_Write(&hi2c1, DevAddress, MemAddress,
|
||||||
pData, Size, 500) != HAL_OK) {
|
I2C_MEMADD_SIZE_8BIT, pData, Size, 500) != HAL_OK) {
|
||||||
|
|
||||||
I2C1_ClearBusyFlagErratum();
|
I2C_Unstick();
|
||||||
xSemaphoreGive(I2CSemaphore);
|
xSemaphoreGive(I2CSemaphore);
|
||||||
}
|
}
|
||||||
xSemaphoreGive(I2CSemaphore);
|
xSemaphoreGive(I2CSemaphore);
|
||||||
#else
|
#else
|
||||||
if (HAL_I2C_Mem_Write(i2c, DevAddress, MemAddress, MemAddSize, pData,
|
if (HAL_I2C_Mem_Write(&hi2c1, DevAddress, MemAddress, I2C_MEMADD_SIZE_8BIT, pData,
|
||||||
Size, 5000) != HAL_OK) {
|
Size, 5000) != HAL_OK) {
|
||||||
}
|
}
|
||||||
xSemaphoreGive(I2CSemaphore);
|
xSemaphoreGive(I2CSemaphore);
|
||||||
@@ -102,7 +102,7 @@ void FRToSI2C::Mem_Write(uint16_t DevAddress, uint16_t MemAddress,
|
|||||||
void FRToSI2C::Transmit(uint16_t DevAddress, uint8_t *pData, uint16_t Size) {
|
void FRToSI2C::Transmit(uint16_t DevAddress, uint8_t *pData, uint16_t Size) {
|
||||||
if (I2CSemaphore == NULL) {
|
if (I2CSemaphore == NULL) {
|
||||||
// no RToS, run blocking code
|
// no RToS, run blocking code
|
||||||
HAL_I2C_Master_Transmit(i2c, DevAddress, pData, Size, 5000);
|
HAL_I2C_Master_Transmit(&hi2c1, DevAddress, pData, Size, 5000);
|
||||||
} else {
|
} else {
|
||||||
// RToS is active, run threading
|
// RToS is active, run threading
|
||||||
// Get the mutex so we can use the I2C port
|
// Get the mutex so we can use the I2C port
|
||||||
@@ -110,15 +110,15 @@ void FRToSI2C::Transmit(uint16_t DevAddress, uint8_t *pData, uint16_t Size) {
|
|||||||
if (xSemaphoreTake(I2CSemaphore, (TickType_t)50) == pdTRUE) {
|
if (xSemaphoreTake(I2CSemaphore, (TickType_t)50) == pdTRUE) {
|
||||||
#ifdef I2CUSESDMA
|
#ifdef I2CUSESDMA
|
||||||
|
|
||||||
if (HAL_I2C_Master_Transmit_DMA(i2c, DevAddress, pData, Size)
|
if (HAL_I2C_Master_Transmit_DMA(&hi2c1, DevAddress, pData, Size)
|
||||||
!= HAL_OK) {
|
!= HAL_OK) {
|
||||||
|
|
||||||
I2C1_ClearBusyFlagErratum();
|
I2C_Unstick();
|
||||||
xSemaphoreGive(I2CSemaphore);
|
xSemaphoreGive(I2CSemaphore);
|
||||||
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
HAL_I2C_Master_Transmit(i2c, DevAddress, pData, Size, 5000);
|
HAL_I2C_Master_Transmit(&hi2c1, DevAddress, pData, Size, 5000);
|
||||||
xSemaphoreGive(I2CSemaphore);
|
xSemaphoreGive(I2CSemaphore);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -130,13 +130,13 @@ void FRToSI2C::Transmit(uint16_t DevAddress, uint8_t *pData, uint16_t Size) {
|
|||||||
|
|
||||||
bool FRToSI2C::probe(uint16_t DevAddress) {
|
bool FRToSI2C::probe(uint16_t DevAddress) {
|
||||||
uint8_t buffer[1];
|
uint8_t buffer[1];
|
||||||
if (Mem_Read(DevAddress, 0, I2C_MEMADD_SIZE_8BIT, buffer, 1)) {
|
if (Mem_Read(DevAddress, 0, buffer, 1)) {
|
||||||
//ACK'd
|
//ACK'd
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FRToSI2C::I2C1_ClearBusyFlagErratum() {
|
void FRToSI2C::I2C_Unstick() {
|
||||||
unstick_I2C();
|
unstick_I2C();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ void preRToSInit() {
|
|||||||
*/
|
*/
|
||||||
HAL_Init();
|
HAL_Init();
|
||||||
Setup_HAL(); // Setup all the HAL objects
|
Setup_HAL(); // Setup all the HAL objects
|
||||||
FRToSI2C::init(&hi2c1);
|
FRToSI2C::init();
|
||||||
HAL_Delay(50);
|
HAL_Delay(50);
|
||||||
HAL_GPIO_WritePin(OLED_RESET_GPIO_Port, OLED_RESET_Pin, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(OLED_RESET_GPIO_Port, OLED_RESET_Pin, GPIO_PIN_SET);
|
||||||
HAL_Delay(50);
|
HAL_Delay(50);
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
#include "Translation.h"
|
#include "Translation.h"
|
||||||
|
|
||||||
#define FONT_12_WIDTH 12
|
#define FONT_12_WIDTH 12
|
||||||
// FONTS ARE NO LONGER HERE, MOVED TO PYTHON AUTO GEN
|
// THE MAIN FONTS ARE NO LONGER HERE, MOVED TO PYTHON AUTO GEN
|
||||||
|
// THESE ARE ONLY THE SYMBOL FONTS
|
||||||
|
|
||||||
const uint8_t ExtraFontChars[] = {
|
const uint8_t ExtraFontChars[] = {
|
||||||
//width = 12
|
//width = 12
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#ifndef FRTOSI2C_HPP_
|
#ifndef FRTOSI2C_HPP_
|
||||||
#define FRTOSI2C_HPP_
|
#define FRTOSI2C_HPP_
|
||||||
#include "stm32f1xx_hal.h"
|
|
||||||
#include "cmsis_os.h"
|
#include "cmsis_os.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -21,8 +21,7 @@
|
|||||||
class FRToSI2C {
|
class FRToSI2C {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static void init(I2C_HandleTypeDef *i2chandle) {
|
static void init() {
|
||||||
i2c = i2chandle;
|
|
||||||
I2CSemaphore = nullptr;
|
I2CSemaphore = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,9 +33,9 @@ public:
|
|||||||
static void CpltCallback(); //Normal Tx Callback
|
static void CpltCallback(); //Normal Tx Callback
|
||||||
|
|
||||||
static bool Mem_Read(uint16_t DevAddress, uint16_t MemAddress,
|
static bool Mem_Read(uint16_t DevAddress, uint16_t MemAddress,
|
||||||
uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
|
uint8_t *pData, uint16_t Size);
|
||||||
static void Mem_Write(uint16_t DevAddress, uint16_t MemAddress,
|
static void Mem_Write(uint16_t DevAddress, uint16_t MemAddress,
|
||||||
uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
|
uint8_t *pData, uint16_t Size);
|
||||||
//Returns true if device ACK's being addressed
|
//Returns true if device ACK's being addressed
|
||||||
static bool probe(uint16_t DevAddress);
|
static bool probe(uint16_t DevAddress);
|
||||||
|
|
||||||
@@ -45,8 +44,7 @@ public:
|
|||||||
static uint8_t I2C_RegisterRead(uint8_t address, uint8_t reg);
|
static uint8_t I2C_RegisterRead(uint8_t address, uint8_t reg);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static I2C_HandleTypeDef *i2c;
|
static void I2C_Unstick();
|
||||||
static void I2C1_ClearBusyFlagErratum();
|
|
||||||
static SemaphoreHandle_t I2CSemaphore;
|
static SemaphoreHandle_t I2CSemaphore;
|
||||||
static StaticSemaphore_t xSemaphoreBuffer;
|
static StaticSemaphore_t xSemaphoreBuffer;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ void LIS2DH12::initalize() {
|
|||||||
void LIS2DH12::getAxisReadings(int16_t &x, int16_t &y, int16_t &z) {
|
void LIS2DH12::getAxisReadings(int16_t &x, int16_t &y, int16_t &z) {
|
||||||
std::array<int16_t, 3> sensorData;
|
std::array<int16_t, 3> sensorData;
|
||||||
|
|
||||||
FRToSI2C::Mem_Read(LIS2DH_I2C_ADDRESS, 0xA8, I2C_MEMADD_SIZE_8BIT,
|
FRToSI2C::Mem_Read(LIS2DH_I2C_ADDRESS, 0xA8,
|
||||||
reinterpret_cast<uint8_t*>(sensorData.begin()),
|
reinterpret_cast<uint8_t*>(sensorData.begin()),
|
||||||
sensorData.size() * sizeof(int16_t));
|
sensorData.size() * sizeof(int16_t));
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
#ifndef LIS2DH12_HPP_
|
#ifndef LIS2DH12_HPP_
|
||||||
#define LIS2DH12_HPP_
|
#define LIS2DH12_HPP_
|
||||||
#include "stm32f1xx_hal.h"
|
|
||||||
#include "I2C_Wrapper.hpp"
|
#include "I2C_Wrapper.hpp"
|
||||||
#include "LIS2DH12_defines.hpp"
|
#include "LIS2DH12_defines.hpp"
|
||||||
#include "BSP.h"
|
#include "BSP.h"
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ void MMA8652FC::initalize() {
|
|||||||
i2c_registers[index].val);
|
i2c_registers[index].val);
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
HAL_Delay(2); // ~1ms delay
|
delay_ms(2); // ~1ms delay
|
||||||
|
|
||||||
while (index < (sizeof(i2c_registers) / sizeof(i2c_registers[0]))) {
|
while (index < (sizeof(i2c_registers) / sizeof(i2c_registers[0]))) {
|
||||||
FRToSI2C::I2C_RegisterWrite(MMA8652FC_I2C_ADDRESS,
|
FRToSI2C::I2C_RegisterWrite(MMA8652FC_I2C_ADDRESS,
|
||||||
@@ -72,7 +72,7 @@ void MMA8652FC::getAxisReadings(int16_t &x, int16_t &y, int16_t &z) {
|
|||||||
std::array<int16_t, 3> sensorData;
|
std::array<int16_t, 3> sensorData;
|
||||||
|
|
||||||
FRToSI2C::Mem_Read(MMA8652FC_I2C_ADDRESS, OUT_X_MSB_REG,
|
FRToSI2C::Mem_Read(MMA8652FC_I2C_ADDRESS, OUT_X_MSB_REG,
|
||||||
I2C_MEMADD_SIZE_8BIT, reinterpret_cast<uint8_t*>(sensorData.begin()),
|
reinterpret_cast<uint8_t*>(sensorData.begin()),
|
||||||
sensorData.size() * sizeof(int16_t));
|
sensorData.size() * sizeof(int16_t));
|
||||||
|
|
||||||
x = static_cast<int16_t>(__builtin_bswap16(
|
x = static_cast<int16_t>(__builtin_bswap16(
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
#ifndef MMA8652FC_HPP_
|
#ifndef MMA8652FC_HPP_
|
||||||
#define MMA8652FC_HPP_
|
#define MMA8652FC_HPP_
|
||||||
#include "stm32f1xx_hal.h"
|
|
||||||
#include "MMA8652FC_defines.h"
|
#include "MMA8652FC_defines.h"
|
||||||
#include "I2C_Wrapper.hpp"
|
#include "I2C_Wrapper.hpp"
|
||||||
#include "BSP.h"
|
#include "BSP.h"
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ uint8_t OLED_Setup_Array[] = {
|
|||||||
const uint8_t REFRESH_COMMANDS[17] = { 0x80, 0xAF, 0x80, 0x21, 0x80, 0x20, 0x80,
|
const uint8_t REFRESH_COMMANDS[17] = { 0x80, 0xAF, 0x80, 0x21, 0x80, 0x20, 0x80,
|
||||||
0x7F, 0x80, 0xC0, 0x80, 0x22, 0x80, 0x00, 0x80, 0x01, 0x40 };
|
0x7F, 0x80, 0xC0, 0x80, 0x22, 0x80, 0x00, 0x80, 0x01, 0x40 };
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Animation timing function that follows a bezier curve.
|
* Animation timing function that follows a bezier curve.
|
||||||
* @param t A given percentage value [0..<100]
|
* @param t A given percentage value [0..<100]
|
||||||
@@ -144,10 +143,10 @@ void OLED::drawScrollIndicator(uint8_t y, uint8_t height) {
|
|||||||
uint16_t whole;
|
uint16_t whole;
|
||||||
uint8_t strips[2];
|
uint8_t strips[2];
|
||||||
} column;
|
} column;
|
||||||
|
|
||||||
column.whole = (1 << height) - 1;
|
column.whole = (1 << height) - 1;
|
||||||
column.whole <<= y;
|
column.whole <<= y;
|
||||||
|
|
||||||
// Draw a one pixel wide bar to the left with a single pixel as
|
// Draw a one pixel wide bar to the left with a single pixel as
|
||||||
// the scroll indicator.
|
// the scroll indicator.
|
||||||
fillArea(OLED_WIDTH - 1, 0, 1, 8, column.strips[0]);
|
fillArea(OLED_WIDTH - 1, 0, 1, 8, column.strips[0]);
|
||||||
@@ -191,11 +190,14 @@ void OLED::transitionSecondaryFramebuffer(bool forwardNavigation) {
|
|||||||
|
|
||||||
offset = progress;
|
offset = progress;
|
||||||
|
|
||||||
memmove(&firstStripPtr[oldStart], &firstStripPtr[oldPrevious], OLED_WIDTH - progress);
|
memmove(&firstStripPtr[oldStart], &firstStripPtr[oldPrevious],
|
||||||
memmove(&secondStripPtr[oldStart], &secondStripPtr[oldPrevious], OLED_WIDTH - progress);
|
OLED_WIDTH - progress);
|
||||||
|
memmove(&secondStripPtr[oldStart], &secondStripPtr[oldPrevious],
|
||||||
|
OLED_WIDTH - progress);
|
||||||
|
|
||||||
memmove(&firstStripPtr[newStart], &firstBackStripPtr[newEnd], progress);
|
memmove(&firstStripPtr[newStart], &firstBackStripPtr[newEnd], progress);
|
||||||
memmove(&secondStripPtr[newStart], &secondBackStripPtr[newEnd], progress);
|
memmove(&secondStripPtr[newStart], &secondBackStripPtr[newEnd],
|
||||||
|
progress);
|
||||||
|
|
||||||
refresh();
|
refresh();
|
||||||
osDelay(40);
|
osDelay(40);
|
||||||
@@ -271,7 +273,7 @@ uint8_t OLED::getFont() {
|
|||||||
inline void stripLeaderZeros(char *buffer, uint8_t places) {
|
inline void stripLeaderZeros(char *buffer, uint8_t places) {
|
||||||
//Removing the leading zero's by swapping them to SymbolSpace
|
//Removing the leading zero's by swapping them to SymbolSpace
|
||||||
// Stop 1 short so that we dont blank entire number if its zero
|
// Stop 1 short so that we dont blank entire number if its zero
|
||||||
for (int i = 0; i < (places-1); i++) {
|
for (int i = 0; i < (places - 1); i++) {
|
||||||
if (buffer[i] == 2) {
|
if (buffer[i] == 2) {
|
||||||
buffer[i] = SymbolSpace[0];
|
buffer[i] = SymbolSpace[0];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
#ifndef OLED_HPP_
|
#ifndef OLED_HPP_
|
||||||
#define OLED_HPP_
|
#define OLED_HPP_
|
||||||
#include <BSP.h>
|
#include <BSP.h>
|
||||||
#include "stm32f1xx_hal.h"
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "I2C_Wrapper.hpp"
|
#include "I2C_Wrapper.hpp"
|
||||||
@@ -27,12 +26,11 @@ extern "C" {
|
|||||||
#define OLED_HEIGHT 16
|
#define OLED_HEIGHT 16
|
||||||
#define FRAMEBUFFER_START 17
|
#define FRAMEBUFFER_START 17
|
||||||
|
|
||||||
class OLED {
|
class OLED {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
enum DisplayState : bool {
|
enum DisplayState : bool {
|
||||||
OFF = false,
|
OFF = false, ON = true
|
||||||
ON = true
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void initialize(); // Startup the I2C coms (brings screen out of reset etc)
|
static void initialize(); // Startup the I2C coms (brings screen out of reset etc)
|
||||||
@@ -40,7 +38,7 @@ public:
|
|||||||
// Draw the buffer out to the LCD using the DMA Channel
|
// Draw the buffer out to the LCD using the DMA Channel
|
||||||
static void refresh() {
|
static void refresh() {
|
||||||
FRToSI2C::Transmit( DEVICEADDR_OLED, screenBuffer,
|
FRToSI2C::Transmit( DEVICEADDR_OLED, screenBuffer,
|
||||||
FRAMEBUFFER_START + (OLED_WIDTH * 2));
|
FRAMEBUFFER_START + (OLED_WIDTH * 2));
|
||||||
//DMA tx time is ~ 20mS Ensure after calling this you delay for at least 25ms
|
//DMA tx time is ~ 20mS Ensure after calling this you delay for at least 25ms
|
||||||
//or we need to goto double buffering
|
//or we need to goto double buffering
|
||||||
}
|
}
|
||||||
@@ -49,16 +47,16 @@ public:
|
|||||||
displayState = state;
|
displayState = state;
|
||||||
screenBuffer[1] = (state == ON) ? 0xAF : 0xAE;
|
screenBuffer[1] = (state == ON) ? 0xAF : 0xAE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setRotation(bool leftHanded); // Set the rotation for the screen
|
static void setRotation(bool leftHanded); // Set the rotation for the screen
|
||||||
// Get the current rotation of the LCD
|
// Get the current rotation of the LCD
|
||||||
static bool getRotation() {
|
static bool getRotation() {
|
||||||
return inLeftHandedMode;
|
return inLeftHandedMode;
|
||||||
}
|
}
|
||||||
static int16_t getCursorX() {
|
static int16_t getCursorX() {
|
||||||
return cursor_x;
|
return cursor_x;
|
||||||
}
|
}
|
||||||
static void print(const char* string);// Draw a string to the current location, with current font
|
static void print(const char *string);// Draw a string to the current location, with current font
|
||||||
// Set the cursor location by pixels
|
// Set the cursor location by pixels
|
||||||
static void setCursor(int16_t x, int16_t y) {
|
static void setCursor(int16_t x, int16_t y) {
|
||||||
cursor_x = x;
|
cursor_x = x;
|
||||||
@@ -71,11 +69,12 @@ public:
|
|||||||
}
|
}
|
||||||
static void setFont(uint8_t fontNumber); // (Future) Set the font that is being used
|
static void setFont(uint8_t fontNumber); // (Future) Set the font that is being used
|
||||||
static uint8_t getFont();
|
static uint8_t getFont();
|
||||||
static void drawImage(const uint8_t* buffer, uint8_t x, uint8_t width) {
|
static void drawImage(const uint8_t *buffer, uint8_t x, uint8_t width) {
|
||||||
drawArea(x, 0, width, 16, buffer);
|
drawArea(x, 0, width, 16, buffer);
|
||||||
}
|
}
|
||||||
// Draws an image to the buffer, at x offset from top to bottom (fixed height renders)
|
// Draws an image to the buffer, at x offset from top to bottom (fixed height renders)
|
||||||
static void printNumber(uint16_t number, uint8_t places,bool noLeaderZeros=true);
|
static void printNumber(uint16_t number, uint8_t places,
|
||||||
|
bool noLeaderZeros = true);
|
||||||
// Draws a number at the current cursor location
|
// Draws a number at the current cursor location
|
||||||
// Clears the buffer
|
// Clears the buffer
|
||||||
static void clearScreen() {
|
static void clearScreen() {
|
||||||
@@ -92,9 +91,9 @@ public:
|
|||||||
static void debugNumber(int32_t val);
|
static void debugNumber(int32_t val);
|
||||||
static void drawSymbol(uint8_t symbolID);//Used for drawing symbols of a predictable width
|
static void drawSymbol(uint8_t symbolID);//Used for drawing symbols of a predictable width
|
||||||
static void drawArea(int16_t x, int8_t y, uint8_t wide, uint8_t height,
|
static void drawArea(int16_t x, int8_t y, uint8_t wide, uint8_t height,
|
||||||
const uint8_t* ptr); //Draw an area, but y must be aligned on 0/8 offset
|
const uint8_t *ptr); //Draw an area, but y must be aligned on 0/8 offset
|
||||||
static void drawAreaSwapped(int16_t x, int8_t y, uint8_t wide, uint8_t height,
|
static void drawAreaSwapped(int16_t x, int8_t y, uint8_t wide,
|
||||||
const uint8_t* ptr); //Draw an area, but y must be aligned on 0/8 offset
|
uint8_t height, const uint8_t *ptr); //Draw an area, but y must be aligned on 0/8 offset
|
||||||
static void fillArea(int16_t x, int8_t y, uint8_t wide, uint8_t height,
|
static void fillArea(int16_t x, int8_t y, uint8_t wide, uint8_t height,
|
||||||
const uint8_t value); //Fill an area, but y must be aligned on 0/8 offset
|
const uint8_t value); //Fill an area, but y must be aligned on 0/8 offset
|
||||||
static void drawFilledRect(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1,
|
static void drawFilledRect(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1,
|
||||||
@@ -106,9 +105,9 @@ public:
|
|||||||
private:
|
private:
|
||||||
static void drawChar(char c); // Draw a character to a specific location
|
static void drawChar(char c); // Draw a character to a specific location
|
||||||
static void setFramebuffer(uint8_t *buffer);
|
static void setFramebuffer(uint8_t *buffer);
|
||||||
static const uint8_t* currentFont;// Pointer to the current font used for rendering to the buffer
|
static const uint8_t *currentFont; // Pointer to the current font used for rendering to the buffer
|
||||||
static uint8_t* firstStripPtr; // Pointers to the strips to allow for buffer having extra content
|
static uint8_t *firstStripPtr; // Pointers to the strips to allow for buffer having extra content
|
||||||
static uint8_t* secondStripPtr; //Pointers to the strips
|
static uint8_t *secondStripPtr; //Pointers to the strips
|
||||||
static bool inLeftHandedMode; // Whether the screen is in left or not (used for offsets in GRAM)
|
static bool inLeftHandedMode; // Whether the screen is in left or not (used for offsets in GRAM)
|
||||||
static DisplayState displayState;
|
static DisplayState displayState;
|
||||||
static uint8_t fontWidth, fontHeight;
|
static uint8_t fontWidth, fontHeight;
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
* Created on: 19 Aug 2019
|
* Created on: 19 Aug 2019
|
||||||
* Author: ralim
|
* Author: ralim
|
||||||
*/
|
*/
|
||||||
|
extern "C" {
|
||||||
|
#include "FreeRTOSConfig.h"
|
||||||
|
}
|
||||||
#include <MMA8652FC.hpp>
|
#include <MMA8652FC.hpp>
|
||||||
#include <gui.hpp>
|
#include <gui.hpp>
|
||||||
#include <main.hpp>
|
#include <main.hpp>
|
||||||
@@ -14,7 +17,6 @@
|
|||||||
#include "Translation.h"
|
#include "Translation.h"
|
||||||
#include "cmsis_os.h"
|
#include "cmsis_os.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "stm32f1xx_hal.h"
|
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "TipThermoModel.h"
|
#include "TipThermoModel.h"
|
||||||
#include "unit.h"
|
#include "unit.h"
|
||||||
@@ -30,10 +32,8 @@ extern osThreadId GUITaskHandle;
|
|||||||
extern osThreadId MOVTaskHandle;
|
extern osThreadId MOVTaskHandle;
|
||||||
extern osThreadId PIDTaskHandle;
|
extern osThreadId PIDTaskHandle;
|
||||||
|
|
||||||
// TODO: express time constants in terms of dividends of portTICK_RATE_MS
|
#define MOVEMENT_INACTIVITY_TIME (60*configTICK_RATE_HZ)
|
||||||
|
#define BUTTON_INACTIVITY_TIME (60*configTICK_RATE_HZ)
|
||||||
#define MOVEMENT_INACTIVITY_TIME 6000
|
|
||||||
#define BUTTON_INACTIVITY_TIME 6000
|
|
||||||
|
|
||||||
static uint16_t min(uint16_t a, uint16_t b) {
|
static uint16_t min(uint16_t a, uint16_t b) {
|
||||||
if (a > b)
|
if (a > b)
|
||||||
@@ -58,36 +58,35 @@ void GUIDelay() {
|
|||||||
void gui_drawTipTemp(bool symbol) {
|
void gui_drawTipTemp(bool symbol) {
|
||||||
// Draw tip temp handling unit conversion & tolerance near setpoint
|
// Draw tip temp handling unit conversion & tolerance near setpoint
|
||||||
uint16_t Temp = 0;
|
uint16_t Temp = 0;
|
||||||
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
||||||
if (systemSettings.temperatureInF)
|
if (systemSettings.temperatureInF)
|
||||||
Temp = TipThermoModel::getTipInF();
|
Temp = TipThermoModel::getTipInF();
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
Temp = TipThermoModel::getTipInC();
|
Temp = TipThermoModel::getTipInC();
|
||||||
|
|
||||||
OLED::printNumber(Temp, 3); // Draw the tip temp out finally
|
OLED::printNumber(Temp, 3); // Draw the tip temp out finally
|
||||||
if (symbol) {
|
if (symbol) {
|
||||||
if (OLED::getFont() == 0) {
|
if (OLED::getFont() == 0) {
|
||||||
//Big font, can draw nice symbols
|
//Big font, can draw nice symbols
|
||||||
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
||||||
if (systemSettings.temperatureInF)
|
if (systemSettings.temperatureInF)
|
||||||
OLED::drawSymbol(0);
|
OLED::drawSymbol(0);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
OLED::drawSymbol(1);
|
OLED::drawSymbol(1);
|
||||||
} else {
|
} else {
|
||||||
//Otherwise fall back to chars
|
//Otherwise fall back to chars
|
||||||
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
||||||
if (systemSettings.temperatureInF)
|
if (systemSettings.temperatureInF)
|
||||||
OLED::print(SymbolDegF);
|
OLED::print(SymbolDegF);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
OLED::print(SymbolDegC);
|
OLED::print(SymbolDegC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef MODEL_TS100
|
#ifdef MODEL_TS100
|
||||||
// returns true if undervoltage has occured
|
// returns true if undervoltage has occured
|
||||||
static bool checkVoltageForExit() {
|
static bool checkVoltageForExit() {
|
||||||
@@ -180,36 +179,48 @@ static void gui_solderingTempAdjust() {
|
|||||||
// exit
|
// exit
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case BUTTON_B_LONG:
|
case BUTTON_B_LONG:
|
||||||
if (xTaskGetTickCount() - autoRepeatTimer
|
if (xTaskGetTickCount() - autoRepeatTimer
|
||||||
+ autoRepeatAcceleration> PRESS_ACCEL_INTERVAL_MAX) {
|
+ autoRepeatAcceleration> PRESS_ACCEL_INTERVAL_MAX) {
|
||||||
if(systemSettings.ReverseButtonTempChangeEnabled) {
|
if (systemSettings.ReverseButtonTempChangeEnabled) {
|
||||||
systemSettings.SolderingTemp += systemSettings.TempChangeLongStep;
|
systemSettings.SolderingTemp +=
|
||||||
} else systemSettings.SolderingTemp -= systemSettings.TempChangeLongStep;
|
systemSettings.TempChangeLongStep;
|
||||||
|
} else
|
||||||
|
systemSettings.SolderingTemp -=
|
||||||
|
systemSettings.TempChangeLongStep;
|
||||||
|
|
||||||
autoRepeatTimer = xTaskGetTickCount();
|
autoRepeatTimer = xTaskGetTickCount();
|
||||||
autoRepeatAcceleration += PRESS_ACCEL_STEP;
|
autoRepeatAcceleration += PRESS_ACCEL_STEP;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BUTTON_B_SHORT:
|
case BUTTON_B_SHORT:
|
||||||
if(systemSettings.ReverseButtonTempChangeEnabled) {
|
if (systemSettings.ReverseButtonTempChangeEnabled) {
|
||||||
systemSettings.SolderingTemp += systemSettings.TempChangeShortStep;
|
systemSettings.SolderingTemp +=
|
||||||
} else systemSettings.SolderingTemp -= systemSettings.TempChangeShortStep;
|
systemSettings.TempChangeShortStep;
|
||||||
break;
|
} else
|
||||||
|
systemSettings.SolderingTemp -=
|
||||||
|
systemSettings.TempChangeShortStep;
|
||||||
|
break;
|
||||||
case BUTTON_F_LONG:
|
case BUTTON_F_LONG:
|
||||||
if (xTaskGetTickCount() - autoRepeatTimer
|
if (xTaskGetTickCount() - autoRepeatTimer
|
||||||
+ autoRepeatAcceleration> PRESS_ACCEL_INTERVAL_MAX) {
|
+ autoRepeatAcceleration> PRESS_ACCEL_INTERVAL_MAX) {
|
||||||
if(systemSettings.ReverseButtonTempChangeEnabled) {
|
if (systemSettings.ReverseButtonTempChangeEnabled) {
|
||||||
systemSettings.SolderingTemp -= systemSettings.TempChangeLongStep;
|
systemSettings.SolderingTemp -=
|
||||||
} else systemSettings.SolderingTemp += systemSettings.TempChangeLongStep;
|
systemSettings.TempChangeLongStep;
|
||||||
|
} else
|
||||||
|
systemSettings.SolderingTemp +=
|
||||||
|
systemSettings.TempChangeLongStep;
|
||||||
autoRepeatTimer = xTaskGetTickCount();
|
autoRepeatTimer = xTaskGetTickCount();
|
||||||
autoRepeatAcceleration += PRESS_ACCEL_STEP;
|
autoRepeatAcceleration += PRESS_ACCEL_STEP;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BUTTON_F_SHORT:
|
case BUTTON_F_SHORT:
|
||||||
if(systemSettings.ReverseButtonTempChangeEnabled) {
|
if (systemSettings.ReverseButtonTempChangeEnabled) {
|
||||||
systemSettings.SolderingTemp -= systemSettings.TempChangeShortStep; // add 10
|
systemSettings.SolderingTemp -=
|
||||||
} else systemSettings.SolderingTemp += systemSettings.TempChangeShortStep; // add 10
|
systemSettings.TempChangeShortStep; // add 10
|
||||||
|
} else
|
||||||
|
systemSettings.SolderingTemp +=
|
||||||
|
systemSettings.TempChangeShortStep; // add 10
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -220,7 +231,7 @@ case BUTTON_B_LONG:
|
|||||||
- PRESS_ACCEL_INTERVAL_MIN;
|
- PRESS_ACCEL_INTERVAL_MIN;
|
||||||
}
|
}
|
||||||
// constrain between 10-450 C
|
// constrain between 10-450 C
|
||||||
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
||||||
if (systemSettings.temperatureInF) {
|
if (systemSettings.temperatureInF) {
|
||||||
if (systemSettings.SolderingTemp > 850)
|
if (systemSettings.SolderingTemp > 850)
|
||||||
systemSettings.SolderingTemp = 850;
|
systemSettings.SolderingTemp = 850;
|
||||||
@@ -244,15 +255,18 @@ case BUTTON_B_LONG:
|
|||||||
#else
|
#else
|
||||||
if (OLED::getRotation()) {
|
if (OLED::getRotation()) {
|
||||||
#endif
|
#endif
|
||||||
OLED::print(systemSettings.ReverseButtonTempChangeEnabled ? SymbolPlus:SymbolMinus);
|
OLED::print(
|
||||||
} else {
|
systemSettings.ReverseButtonTempChangeEnabled ?
|
||||||
OLED::print(systemSettings.ReverseButtonTempChangeEnabled ? SymbolMinus:SymbolPlus);
|
SymbolPlus : SymbolMinus);
|
||||||
|
} else {
|
||||||
|
OLED::print(
|
||||||
|
systemSettings.ReverseButtonTempChangeEnabled ?
|
||||||
|
SymbolMinus : SymbolPlus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
OLED::print(SymbolSpace);
|
OLED::print(SymbolSpace);
|
||||||
OLED::printNumber(systemSettings.SolderingTemp, 3);
|
OLED::printNumber(systemSettings.SolderingTemp, 3);
|
||||||
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
||||||
if (systemSettings.temperatureInF)
|
if (systemSettings.temperatureInF)
|
||||||
OLED::drawSymbol(0);
|
OLED::drawSymbol(0);
|
||||||
else
|
else
|
||||||
@@ -266,9 +280,13 @@ case BUTTON_B_LONG:
|
|||||||
#else
|
#else
|
||||||
if (OLED::getRotation()) {
|
if (OLED::getRotation()) {
|
||||||
#endif
|
#endif
|
||||||
OLED::print(systemSettings.ReverseButtonTempChangeEnabled ? SymbolMinus:SymbolPlus);
|
OLED::print(
|
||||||
|
systemSettings.ReverseButtonTempChangeEnabled ?
|
||||||
|
SymbolMinus : SymbolPlus);
|
||||||
} else {
|
} else {
|
||||||
OLED::print(systemSettings.ReverseButtonTempChangeEnabled ? SymbolPlus:SymbolMinus);
|
OLED::print(
|
||||||
|
systemSettings.ReverseButtonTempChangeEnabled ?
|
||||||
|
SymbolPlus : SymbolMinus);
|
||||||
}
|
}
|
||||||
OLED::refresh();
|
OLED::refresh();
|
||||||
GUIDelay();
|
GUIDelay();
|
||||||
@@ -283,8 +301,8 @@ static int gui_SolderingSleepingMode(bool stayOff) {
|
|||||||
if (buttons)
|
if (buttons)
|
||||||
return 0;
|
return 0;
|
||||||
if ((xTaskGetTickCount() > 100)
|
if ((xTaskGetTickCount() > 100)
|
||||||
&& ((accelInit && (xTaskGetTickCount() - lastMovementTime < 100))
|
&& ((accelInit && (xTaskGetTickCount() - lastMovementTime < 100))
|
||||||
|| (xTaskGetTickCount() - lastButtonTime < 100)))
|
|| (xTaskGetTickCount() - lastButtonTime < 100)))
|
||||||
return 0; // user moved or pressed a button, go back to soldering
|
return 0; // user moved or pressed a button, go back to soldering
|
||||||
#ifdef MODEL_TS100
|
#ifdef MODEL_TS100
|
||||||
if (checkVoltageForExit())
|
if (checkVoltageForExit())
|
||||||
@@ -298,8 +316,11 @@ static int gui_SolderingSleepingMode(bool stayOff) {
|
|||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
currentTempTargetDegC = stayOff ? 0 : min(systemSettings.SleepTemp,
|
currentTempTargetDegC =
|
||||||
systemSettings.SolderingTemp);
|
stayOff ?
|
||||||
|
0 :
|
||||||
|
min(systemSettings.SleepTemp,
|
||||||
|
systemSettings.SolderingTemp);
|
||||||
}
|
}
|
||||||
// draw the lcd
|
// draw the lcd
|
||||||
uint16_t tipTemp;
|
uint16_t tipTemp;
|
||||||
@@ -656,32 +677,18 @@ void startGUITask(void const *argument __unused) {
|
|||||||
|
|
||||||
if (systemSettings.autoStartMode) {
|
if (systemSettings.autoStartMode) {
|
||||||
// jump directly to the autostart mode
|
// jump directly to the autostart mode
|
||||||
if (systemSettings.autoStartMode == 1)
|
if (systemSettings.autoStartMode == 1) {
|
||||||
{
|
|
||||||
gui_solderingMode(0);
|
gui_solderingMode(0);
|
||||||
buttonLockout = true;
|
buttonLockout = true;
|
||||||
}
|
} else if (systemSettings.autoStartMode == 2) {
|
||||||
else if (systemSettings.autoStartMode == 2)
|
|
||||||
{
|
|
||||||
gui_solderingMode(1);
|
gui_solderingMode(1);
|
||||||
buttonLockout = true;
|
buttonLockout = true;
|
||||||
}
|
} else if (systemSettings.autoStartMode == 3) {
|
||||||
else if (systemSettings.autoStartMode == 3)
|
|
||||||
{
|
|
||||||
gui_solderingMode(2);
|
gui_solderingMode(2);
|
||||||
buttonLockout = true;
|
buttonLockout = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ACCELDEBUG
|
|
||||||
|
|
||||||
for (;;) {
|
|
||||||
HAL_IWDG_Refresh(&hiwdg);
|
|
||||||
osDelay(100);
|
|
||||||
}
|
|
||||||
//^ Kept here for a way to block this thread
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
ButtonState buttons = getButtonState();
|
ButtonState buttons = getButtonState();
|
||||||
if (buttons != BUTTON_NONE) {
|
if (buttons != BUTTON_NONE) {
|
||||||
|
|||||||
Reference in New Issue
Block a user