Compare commits
No commits in common. "3dfe59482ec5fe125e8a3343cdd39c0a21f46aef" and "80edd095285a6d9955ab2a1aa563e9d64a19db55" have entirely different histories.
3dfe59482e
...
80edd09528
@ -58,31 +58,3 @@ Calibration is most likely not necessary! See the :ref:`usage_calibration` page.
|
||||
|
||||
The command will guide you through the calibration process and will ask for two reference resistors with ``1000 Ohm`` and ``2000 Ohm`` values.
|
||||
Calibration can be aborted using ``CTRL + C``.
|
||||
|
||||
|
||||
.. _shell_command_hang:
|
||||
|
||||
hang
|
||||
~~~~
|
||||
|
||||
The ``hang`` command hangs the main-loop in an infinite loop. This function tests, whether the controller is correctly rescued by the watchdog.
|
||||
|
||||
|
||||
.. _shell_command_ui_emulate:
|
||||
|
||||
ui-emulate
|
||||
~~~~~~~~~~
|
||||
|
||||
The ``ui-emulate`` command emulates the rotary encoder and button from the shell. The following keys are available:
|
||||
|
||||
========== ================================
|
||||
Key Emulation
|
||||
========== ================================
|
||||
``CTRL+C`` Exit the command
|
||||
``ENTER`` Button press: short released
|
||||
``s`` Rotary Encoder: anti-clockwise
|
||||
``w`` Rotary Encoder: clockwise
|
||||
``l`` Button press: long
|
||||
``k`` Button press: short
|
||||
``r`` Button press: long released
|
||||
========== ================================
|
||||
|
@ -29,7 +29,6 @@
|
||||
|
||||
static volatile uint64_t IN_SECTION(.ccm.bss) to_active_timestamp;
|
||||
static volatile enum button_state IN_SECTION(.ccm.bss) int_state;
|
||||
static volatile enum button_state IN_SECTION(.ccm.bss) override_state;
|
||||
|
||||
void button_init()
|
||||
{
|
||||
@ -41,7 +40,6 @@ void button_init()
|
||||
|
||||
to_active_timestamp = 0ULL;
|
||||
int_state = BUTTON_IDLE;
|
||||
override_state = BUTTON_IDLE;
|
||||
|
||||
SYSCFG->EXTICR[1] |= 0x3;
|
||||
EXTI->IMR |= (1U<<4);
|
||||
@ -55,12 +53,6 @@ enum button_state button_read_event()
|
||||
uint64_t time_delta;
|
||||
enum button_state temp_state;
|
||||
|
||||
if (override_state != BUTTON_IDLE) {
|
||||
temp_state = override_state;
|
||||
override_state = BUTTON_IDLE;
|
||||
return temp_state;
|
||||
}
|
||||
|
||||
if (BUTTON_PORT->IDR & (1U<<BUTTON_PIN)) {
|
||||
temp_state = int_state;
|
||||
int_state = BUTTON_IDLE;
|
||||
@ -104,8 +96,3 @@ void EXTI4_IRQHandler(void)
|
||||
to_active_timestamp = systick_get_global_tick();
|
||||
}
|
||||
}
|
||||
|
||||
void button_override_event(enum button_state state)
|
||||
{
|
||||
override_state = state;
|
||||
}
|
||||
|
@ -72,10 +72,5 @@ enum button_state button_read_event();
|
||||
*/
|
||||
void button_deinit();
|
||||
|
||||
/**
|
||||
* @brief This function overrides the button event.
|
||||
* @param state State to set
|
||||
*/
|
||||
void button_override_event(enum button_state state);
|
||||
|
||||
#endif /* __BUTTON_H__ */
|
||||
|
@ -41,6 +41,4 @@ void rotary_encoder_stop(void);
|
||||
|
||||
void rotary_encoder_zero(void);
|
||||
|
||||
void rotary_encoder_override_delta(int16_t delta);
|
||||
|
||||
#endif /* __ROTARY_ENCODER_H__ */
|
||||
|
@ -23,8 +23,6 @@
|
||||
#include <stm-periph/stm32-gpio-macros.h>
|
||||
#include <helper-macros/helper-macros.h>
|
||||
|
||||
static int16_t IN_SECTION(.ccm.bss) override_delta;
|
||||
|
||||
static inline void rotary_encoder_setup_pins(void)
|
||||
{
|
||||
rcc_manager_enable_clock(&RCC->AHB1ENR, BITMASK_TO_BITNO(ROTARY_ENCODER_RCC_MASK));
|
||||
@ -47,8 +45,6 @@ void rotary_encoder_setup(void)
|
||||
ROTARY_ENCODER_TIMER->CCER = TIM_CCER_CC1P | TIM_CCER_CC2P;
|
||||
ROTARY_ENCODER_TIMER->PSC = 0;
|
||||
ROTARY_ENCODER_TIMER->CR1 = TIM_CR1_CEN;
|
||||
|
||||
override_delta = 0;
|
||||
}
|
||||
|
||||
uint32_t rotary_encoder_get_abs_val(void)
|
||||
@ -76,9 +72,6 @@ int32_t rotary_encoder_get_change_val(void)
|
||||
|
||||
last_val = val;
|
||||
|
||||
diff += override_delta;
|
||||
override_delta = 0;
|
||||
|
||||
return diff;
|
||||
}
|
||||
|
||||
@ -95,8 +88,3 @@ void rotary_encoder_zero(void)
|
||||
{
|
||||
ROTARY_ENCODER_TIMER->CNT = 0UL;
|
||||
}
|
||||
|
||||
void rotary_encoder_override_delta(int16_t delta)
|
||||
{
|
||||
override_delta = delta;
|
||||
}
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include <reflow-controller/rotary-encoder.h>
|
||||
#include <reflow-controller/safety/safety-controller.h>
|
||||
#include <reflow-controller/settings/settings.h>
|
||||
#include <reflow-controller/button.h>
|
||||
|
||||
#ifndef GIT_VER
|
||||
#define GIT_VER "VERSION NOT SET"
|
||||
@ -459,48 +458,6 @@ static shellmatta_retCode_t shell_cmd_hang(const shellmatta_handle_t handle, con
|
||||
return SHELLMATTA_OK;
|
||||
}
|
||||
|
||||
static shellmatta_retCode_t shell_cmd_ui_emulation(const shellmatta_handle_t handle, const char *arguments,
|
||||
uint32_t length)
|
||||
{
|
||||
(void)length;
|
||||
(void)arguments;
|
||||
uint32_t i;
|
||||
uint32_t len;
|
||||
char *buff;
|
||||
|
||||
shellmatta_read(handle, &buff, &len);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
switch (buff[i]) {
|
||||
case 'W':
|
||||
case 'w':
|
||||
rotary_encoder_override_delta(4);
|
||||
break;
|
||||
case 's':
|
||||
case 'S':
|
||||
rotary_encoder_override_delta(-4);
|
||||
break;
|
||||
case '\r':
|
||||
button_override_event(BUTTON_SHORT_RELEASED);
|
||||
break;
|
||||
case 'l':
|
||||
case 'L':
|
||||
button_override_event(BUTTON_LONG);
|
||||
break;
|
||||
case 'k':
|
||||
case 'K':
|
||||
button_override_event(BUTTON_SHORT);
|
||||
break;
|
||||
case 'r':
|
||||
case 'R':
|
||||
button_override_event(BUTTON_LONG_RELEASED);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return SHELLMATTA_CONTINUE;
|
||||
}
|
||||
|
||||
//typedef struct shellmatta_cmd
|
||||
//{
|
||||
// char *cmd; /**< command name */
|
||||
@ -510,7 +467,7 @@ static shellmatta_retCode_t shell_cmd_ui_emulation(const shellmatta_handle_t han
|
||||
// shellmatta_cmdFct_t cmdFct; /**< pointer to the cmd callack function */
|
||||
// struct shellmatta_cmd *next; /**< pointer to next command or NULL */
|
||||
//} shellmatta_cmd_t;
|
||||
static shellmatta_cmd_t cmd[16] = {
|
||||
static shellmatta_cmd_t cmd[15] = {
|
||||
{
|
||||
.cmd = "version",
|
||||
.cmdAlias = "ver",
|
||||
@ -629,16 +586,8 @@ static shellmatta_cmd_t cmd[16] = {
|
||||
.helpText = "",
|
||||
.usageText = "",
|
||||
.cmdFct = shell_cmd_hang,
|
||||
.next = &cmd[15],
|
||||
},
|
||||
{
|
||||
.cmd = "ui-emulate",
|
||||
.cmdAlias = NULL,
|
||||
.helpText = "",
|
||||
.usageText = "",
|
||||
.cmdFct = shell_cmd_ui_emulation,
|
||||
.next = NULL,
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
shellmatta_handle_t shell_init(shellmatta_write_t write_func)
|
||||
|
Loading…
x
Reference in New Issue
Block a user