Bump I2C speed back up
This commit is contained in:
@@ -148,7 +148,7 @@ static void MX_ADC1_Init(void) {
|
|||||||
static void MX_I2C1_Init(void) {
|
static void MX_I2C1_Init(void) {
|
||||||
|
|
||||||
hi2c1.Instance = I2C1;
|
hi2c1.Instance = I2C1;
|
||||||
hi2c1.Init.ClockSpeed = 50000;
|
hi2c1.Init.ClockSpeed = 100000;
|
||||||
hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2;
|
hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2;
|
||||||
hi2c1.Init.OwnAddress1 = 0;
|
hi2c1.Init.OwnAddress1 = 0;
|
||||||
hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
|
hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
|
||||||
|
|||||||
@@ -102,38 +102,40 @@ static void printShortDescription(uint32_t shortDescIndex,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int userConfirmation(const char* message) {
|
static int userConfirmation(const char* message) {
|
||||||
uint8_t maxOffset = strlen(message) + 7;
|
uint8_t maxOffset = strlen(message) + 7;
|
||||||
uint32_t messageStart = xTaskGetTickCount();
|
uint32_t messageStart = xTaskGetTickCount();
|
||||||
|
|
||||||
lcd.setFont(0);
|
lcd.setFont(0);
|
||||||
lcd.setCursor(0, 0);
|
lcd.setCursor(0, 0);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
int16_t messageOffset = (((xTaskGetTickCount() - messageStart) / 15) % maxOffset);
|
int16_t messageOffset = (((xTaskGetTickCount() - messageStart) / 15)
|
||||||
|
% maxOffset);
|
||||||
|
|
||||||
lcd.clearScreen();
|
lcd.clearScreen();
|
||||||
lcd.setCursor(12 * (7 - messageOffset), 0);
|
lcd.setCursor(12 * (7 - messageOffset), 0);
|
||||||
lcd.print(message);
|
lcd.print(message);
|
||||||
|
|
||||||
ButtonState buttons = getButtonState();
|
ButtonState buttons = getButtonState();
|
||||||
switch (buttons) {
|
switch (buttons) {
|
||||||
case BUTTON_F_SHORT:
|
case BUTTON_F_SHORT:
|
||||||
//User confirmed
|
//User confirmed
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case BUTTON_BOTH:
|
case BUTTON_NONE:
|
||||||
case BUTTON_B_SHORT:
|
break;
|
||||||
case BUTTON_F_LONG:
|
default:
|
||||||
case BUTTON_B_LONG:
|
case BUTTON_BOTH:
|
||||||
return 0;
|
case BUTTON_B_SHORT:
|
||||||
|
case BUTTON_F_LONG:
|
||||||
|
case BUTTON_B_LONG:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
case BUTTON_NONE:
|
lcd.refresh();
|
||||||
break;
|
osDelay(50);
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
lcd.refresh();
|
|
||||||
osDelay(50);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ static void gui_settingsMenu() {
|
|||||||
descriptionStart = HAL_GetTick();
|
descriptionStart = HAL_GetTick();
|
||||||
|
|
||||||
int16_t descriptionOffset = ((((HAL_GetTick() - descriptionStart)
|
int16_t descriptionOffset = ((((HAL_GetTick() - descriptionStart)
|
||||||
/ 10) % (maxOffset * 3))) * 4;
|
/ 30) % (maxOffset * 3))) * 4;
|
||||||
//^ Rolling offset based on time
|
//^ Rolling offset based on time
|
||||||
lcd.setCursor(((7 * 12) - descriptionOffset), 0);
|
lcd.setCursor(((7 * 12) - descriptionOffset), 0);
|
||||||
lcd.print(settingsMenu[currentScreen].description);
|
lcd.print(settingsMenu[currentScreen].description);
|
||||||
@@ -749,13 +749,13 @@ void startGUITask(void const *argument) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
uint32_t ticks = xTaskGetTickCount();
|
uint32_t ticks = xTaskGetTickCount();
|
||||||
ticks += 400; //4 seconds
|
ticks += 400; //4 seconds from now
|
||||||
while (xTaskGetTickCount() < ticks) {
|
while (xTaskGetTickCount() < ticks) {
|
||||||
if (showBootLogoIfavailable() == false)
|
if (showBootLogoIfavailable() == false)
|
||||||
ticks = xTaskGetTickCount();
|
ticks = xTaskGetTickCount();
|
||||||
ButtonState buttons = getButtonState();
|
ButtonState buttons = getButtonState();
|
||||||
if (buttons)
|
if (buttons)
|
||||||
ticks = xTaskGetTickCount();
|
ticks = xTaskGetTickCount();//make timeout now so we will exit
|
||||||
GUIDelay();
|
GUIDelay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user