aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBen V. Brown <[email protected]>2018-03-03 21:20:01 +1100
committerBen V. Brown <[email protected]>2018-03-03 21:20:01 +1100
commit57949a7937824f97dd1f6b5351aa83a4ba971208 (patch)
treee7f0ccfa62354d76192ff6b5d474a5160e45cbd8
parentf14ea321a774ba5418626078e9376ac5cdc92a21 (diff)
downloadIronOS-57949a7937824f97dd1f6b5351aa83a4ba971208.tar.gz
IronOS-57949a7937824f97dd1f6b5351aa83a4ba971208.zip
Bump I2C speed back up
-rw-r--r--workspace/TS100/src/Setup.c2
-rw-r--r--workspace/TS100/src/gui.cpp66
-rw-r--r--workspace/TS100/src/main.cpp6
3 files changed, 38 insertions, 36 deletions
diff --git a/workspace/TS100/src/Setup.c b/workspace/TS100/src/Setup.c
index 51e7c772..5a97dca2 100644
--- a/workspace/TS100/src/Setup.c
+++ b/workspace/TS100/src/Setup.c
@@ -148,7 +148,7 @@ static void MX_ADC1_Init(void) {
static void MX_I2C1_Init(void) {
hi2c1.Instance = I2C1;
- hi2c1.Init.ClockSpeed = 50000;
+ hi2c1.Init.ClockSpeed = 100000;
hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2;
hi2c1.Init.OwnAddress1 = 0;
hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
diff --git a/workspace/TS100/src/gui.cpp b/workspace/TS100/src/gui.cpp
index 8c4e3faa..ddc3cbb5 100644
--- a/workspace/TS100/src/gui.cpp
+++ b/workspace/TS100/src/gui.cpp
@@ -102,38 +102,40 @@ static void printShortDescription(uint32_t shortDescIndex,
}
static int userConfirmation(const char* message) {
- uint8_t maxOffset = strlen(message) + 7;
- uint32_t messageStart = xTaskGetTickCount();
-
- lcd.setFont(0);
- lcd.setCursor(0, 0);
-
- for (;;) {
- int16_t messageOffset = (((xTaskGetTickCount() - messageStart) / 15) % maxOffset);
-
- lcd.clearScreen();
- lcd.setCursor(12 * (7 - messageOffset), 0);
- lcd.print(message);
-
- ButtonState buttons = getButtonState();
- switch (buttons) {
- case BUTTON_F_SHORT:
- //User confirmed
- return 1;
-
- case BUTTON_BOTH:
- case BUTTON_B_SHORT:
- case BUTTON_F_LONG:
- case BUTTON_B_LONG:
- return 0;
-
- case BUTTON_NONE:
- break;
- }
-
- lcd.refresh();
- osDelay(50);
- }
+ uint8_t maxOffset = strlen(message) + 7;
+ uint32_t messageStart = xTaskGetTickCount();
+
+ lcd.setFont(0);
+ lcd.setCursor(0, 0);
+
+ for (;;) {
+ int16_t messageOffset = (((xTaskGetTickCount() - messageStart) / 15)
+ % maxOffset);
+
+ lcd.clearScreen();
+ lcd.setCursor(12 * (7 - messageOffset), 0);
+ lcd.print(message);
+
+ ButtonState buttons = getButtonState();
+ switch (buttons) {
+ case BUTTON_F_SHORT:
+ //User confirmed
+ return 1;
+
+ case BUTTON_NONE:
+ break;
+ default:
+ case BUTTON_BOTH:
+ case BUTTON_B_SHORT:
+ case BUTTON_F_LONG:
+ case BUTTON_B_LONG:
+ return 0;
+ }
+
+ lcd.refresh();
+ osDelay(50);
+ }
+ return 0;
}
diff --git a/workspace/TS100/src/main.cpp b/workspace/TS100/src/main.cpp
index 351bb4a3..0c39fcc1 100644
--- a/workspace/TS100/src/main.cpp
+++ b/workspace/TS100/src/main.cpp
@@ -349,7 +349,7 @@ static void gui_settingsMenu() {
descriptionStart = HAL_GetTick();
int16_t descriptionOffset = ((((HAL_GetTick() - descriptionStart)
- / 10) % (maxOffset * 3))) * 4;
+ / 30) % (maxOffset * 3))) * 4;
//^ Rolling offset based on time
lcd.setCursor(((7 * 12) - descriptionOffset), 0);
lcd.print(settingsMenu[currentScreen].description);
@@ -749,13 +749,13 @@ void startGUITask(void const *argument) {
break;
}
uint32_t ticks = xTaskGetTickCount();
- ticks += 400; //4 seconds
+ ticks += 400; //4 seconds from now
while (xTaskGetTickCount() < ticks) {
if (showBootLogoIfavailable() == false)
ticks = xTaskGetTickCount();
ButtonState buttons = getButtonState();
if (buttons)
- ticks = xTaskGetTickCount();
+ ticks = xTaskGetTickCount();//make timeout now so we will exit
GUIDelay();
}