Skip to content

Commit

Permalink
config loading stability improved
Browse files Browse the repository at this point in the history
  • Loading branch information
Yury Vostrenkov committed Jan 20, 2022
1 parent b133f8b commit cabbabe
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion application/Inc/common_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

//#define DEBUG

#define FIRMWARE_VERSION 0x1711 // v1.7.1b1
#define FIRMWARE_VERSION 0x1712 // v1.7.1b2
#define USED_PINS_NUM 30 // constant for BluePill and BlackPill boards
#define MAX_AXIS_NUM 8 // max 8
#define MAX_BUTTONS_NUM 128 // power of 2, max 128
Expand Down
2 changes: 1 addition & 1 deletion application/Inc/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

static const dev_config_t init_config =
{
.firmware_version = 0x1711, // do not change
.firmware_version = 0x1712, // do not change
/*
Name of device in devices dispatcher
*/
Expand Down
6 changes: 3 additions & 3 deletions application/Src/buttons.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ uint8_t a2b_last = 0;
*/
void ButtonsDebounceProcess (dev_config_t * p_dev_config)
{
uint32_t millis;
int64_t millis;
uint16_t debounce;

millis = GetMillis();
Expand Down Expand Up @@ -88,7 +88,7 @@ void ButtonsDebounceProcess (dev_config_t * p_dev_config)
}
}

static void LogicalButtonProcessTimer (logical_buttons_state_t * p_button_state, uint32_t millis, dev_config_t * p_dev_config, uint8_t num)
static void LogicalButtonProcessTimer (logical_buttons_state_t * p_button_state, int64_t millis, dev_config_t * p_dev_config, uint8_t num)
{
uint16_t tmp_press_time;
uint16_t tmp_delay_time;
Expand Down Expand Up @@ -180,7 +180,7 @@ static void LogicalButtonProcessTimer (logical_buttons_state_t * p_button_state,
void LogicalButtonProcessState (logical_buttons_state_t * p_button_state, uint8_t * pov_buf, dev_config_t * p_dev_config, uint8_t num)
{

uint32_t millis;
int64_t millis;
uint8_t pov_group = 0;

millis = GetMillis();
Expand Down
2 changes: 1 addition & 1 deletion application/Src/encoders.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void EncoderProcess (logical_buttons_state_t * button_state_buf, dev_config_t *
uint8_t tmp_a = 0;
uint8_t tmp_b = 0;

uint32_t millis = GetMillis();
int64_t millis = GetMillis();

for (int k = 0; k < MAX_ENCODERS_NUM; k++)
{
Expand Down
14 changes: 7 additions & 7 deletions application/Src/stm32f10x_it.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@

/* Private variables ---------------------------------------------------------*/

volatile uint64_t millis = 0;
volatile uint64_t joy_millis = 0;
volatile uint64_t encoder_ticks = 0;
volatile uint64_t adc_ticks = 0;
volatile uint64_t sensors_ticks = 1;
volatile uint64_t buttons_ticks = 0;
volatile uint64_t configurator_millis = 0;
volatile int64_t millis = 0;
volatile int64_t joy_millis = 0;
volatile int64_t encoder_ticks = 0;
volatile int64_t adc_ticks = 0;
volatile int64_t sensors_ticks = 1;
volatile int64_t buttons_ticks = 0;
volatile int64_t configurator_millis = 0;
volatile int status = 0;
extern dev_config_t dev_config;

Expand Down
12 changes: 6 additions & 6 deletions application/Src/usb_endp.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
volatile extern uint8_t bootloader;
volatile extern uint64_t joy_millis;
volatile extern uint64_t encoder_ticks;
volatile extern uint64_t adc_ticks;
volatile extern uint64_t sensors_ticks;
volatile extern uint64_t buttons_ticks;
volatile extern uint64_t configurator_millis;
volatile extern int64_t joy_millis;
volatile extern int64_t encoder_ticks;
volatile extern int64_t adc_ticks;
volatile extern int64_t sensors_ticks;
volatile extern int64_t buttons_ticks;
volatile extern int64_t configurator_millis;

__IO uint8_t EP1_PrevXferComplete = 1;
__IO uint8_t EP2_PrevXferComplete = 1;
Expand Down

0 comments on commit cabbabe

Please sign in to comment.