Skip to content

Commit

Permalink
Merge pull request #6 from FreeSK8/0.2.1
Browse files Browse the repository at this point in the history
0.2.1
  • Loading branch information
r3n33 authored Oct 19, 2021
2 parents 8373540 + c452a31 commit 8f22c0e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
v0.2.1

* Disallow Throttle Lock in Setup Menu
* Wrap triple digit speeds
* Fix displayed throttle position
* Dim displayed speed with 1s of ESC inactivity

v0.2.0

* Added Left Handed User Setting
Expand Down
11 changes: 7 additions & 4 deletions main/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,9 @@ TickType_t drawScreenPrimary(TFT_t * dev, FontxFile *fx, int width, int height,
} else {
joystick_position = 0;
}
if (abs(joystick_value_mapped_previous - joystick_value_mapped) > 12)
if (joystick_value_mapped_previous != joystick_value_mapped)
{
joystick_value_mapped_previous = joystick_value_mapped;
printf("joy %d, %f, %d\n", joystick_value_mapped, joystick_position, (int)(100-(joystick_position * 100)));
drawCircularGauge(dev, 120, 110, 85, 5, 0, 90, 100-(joystick_position * 100), BLACK, PURPLE);
}

Expand Down Expand Up @@ -387,16 +386,20 @@ TickType_t drawScreenPrimary(TFT_t * dev, FontxFile *fx, int width, int height,
int speed_now = 0;
if (user_settings->display_mph) speed_now = (int)(esc_telemetry.speed * metersPerSecondToKph * KTOM);
else speed_now = (int)(esc_telemetry.speed * metersPerSecondToKph);
// Ensure all speeds are positive
speed_now = abs(speed_now);
// Wrap Speed if triple digits
if (speed_now > 99) speed_now -= 100;
// Check if ESC is responding
bool is_esc_responding = (xTaskGetTickCount() - esc_last_responded)*portTICK_RATE_MS < 10 * 1000;
bool is_esc_responding = (xTaskGetTickCount() - esc_last_responded)*portTICK_RATE_MS < 1000;
// Update only when changing or esc starts/stops responding
if (speed_now != speed_now_previous || is_esc_responding != was_esc_responding)
{
was_esc_responding = is_esc_responding;
fontWidth = 6;
fontHeight = 5;
speed_now_previous = speed_now;
sprintf((char *)ascii, "%02d", abs(speed_now));
sprintf((char *)ascii, "%02d", speed_now);
{
ypos = 60;
xpos = (width - (strlen((char *)ascii) * 8 * fontWidth)) / 2;
Expand Down
12 changes: 9 additions & 3 deletions main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include "lib/haptic/haptic.h"

const char * version = "0.2.0";
const char * version = "0.2.1";

#define ADC_BATTERY_MIN 525

Expand Down Expand Up @@ -271,6 +271,10 @@ static void gpio_input_task(void* arg)
}
if ((ev.pin == GPIO_INPUT_IO_0) && (ev.event == BUTTON_DOUBLE_CLICK)) {
// SW3 on HW v1.2 PCB

// Do not throttle lock in setup mode
if (remote_in_setup_mode) continue;

is_throttle_locked = !is_throttle_locked; // Toggle throttle lock
if (is_throttle_locked)
{
Expand Down Expand Up @@ -891,10 +895,12 @@ void ST7789_Task(void *pvParameters)
int8_t x_offset = 0;
switch (my_user_settings.remote_model) {
case MODEL_ALBERT:
x_offset = -5;
if (my_user_settings.left_handed) x_offset = 5;
else x_offset = -5;
break;
case MODEL_BRUCE:
x_offset = -2;
if (my_user_settings.left_handed) x_offset = 2;
else x_offset = -2;
break;
case MODEL_CUSTOM:
x_offset = 0;
Expand Down

0 comments on commit 8f22c0e

Please sign in to comment.