Add code for rotary encoder
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include <reflow-controller/adc-meas.h>
|
||||
#include <reflow-controller/shell.h>
|
||||
#include <reflow-controller/digio.h>
|
||||
#include <reflow-controller/rotary-encoder.h>
|
||||
#include <stm-periph/stm32-gpio-macros.h>
|
||||
#include <stm-periph/clock-enable-manager.h>
|
||||
#include <stm-periph/uart.h>
|
||||
@@ -45,6 +46,8 @@ static void setup_nvic_priorities()
|
||||
|
||||
static float pt1000_value;
|
||||
static volatile int pt1000_value_status;
|
||||
static uint32_t rot;
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -61,6 +64,7 @@ int main()
|
||||
digio_setup_default_all();
|
||||
led_setup();
|
||||
loudspeaker_setup();
|
||||
rotary_encoder_setup();
|
||||
|
||||
uart_init_with_dma();
|
||||
|
||||
@@ -68,7 +72,7 @@ int main()
|
||||
|
||||
while(1) {
|
||||
pt1000_value_status = adc_pt1000_get_current_resistance(&pt1000_value);
|
||||
|
||||
rot = rotary_encoder_get_abs_val();
|
||||
uart_receive_status = uart_receive_data_with_dma(&uart_input, &uart_input_len);
|
||||
if (uart_receive_status >= 1)
|
||||
shell_handle_input(shell_handle, uart_input, uart_input_len);
|
||||
|
Reference in New Issue
Block a user