Skip to content

Commit

Permalink
tesst vibration
Browse files Browse the repository at this point in the history
  • Loading branch information
e-dddos committed Jun 10, 2024
1 parent eae7d25 commit f9a98f0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
9 changes: 8 additions & 1 deletion node/code/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@
#include "events.h"
#include "fsm.h"
#include "thread.h"
#include "io_handler.h"
#include "init_buttons.h"


#define SHELL_QUEUE_SIZE (8)
static msg_t _shell_queue[SHELL_QUEUE_SIZE];


int main(void)
{
{
fsm_start_thread();
msg_init_queue(_shell_queue, SHELL_QUEUE_SIZE);
while (1) {
vibrate(500);
ztimer_sleep(ZTIMER_MSEC, 500);
}
shell_loop();
}
5 changes: 2 additions & 3 deletions node/code/modules/io_handler/init_buttons.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
#define ENABLE_DEBUG 1
#include "debug.h"

//Define the Vvibration time:
#define VIBRATION_TIME_MSEC 500

//Define the physical GPIO Pins used for buttons:
gpio_t button_ok = GPIO_PIN(0, 5); //PIN A1
gpio_t button_right = GPIO_PIN(0, 30); //PIN sA2
Expand Down Expand Up @@ -56,8 +53,10 @@ int init_buttons(void)

//Vibrate for msec milliseconds:
void vibrate(uint16_t msec) {

gpio_set(vibr_gpio);
ztimer_sleep(ZTIMER_MSEC, msec);
gpio_clear(vibr_gpio);
}

void button_up_callback (void *arg)
Expand Down
2 changes: 1 addition & 1 deletion node/code/modules/io_handler/io_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "init_buttons.h"
#include "io_handler.h"

//Define the vibration time here:
//Define the vibration time (milliseconds) here:
#define VIBRATE_FOR_MSEC 500

void io_init(void){
Expand Down

0 comments on commit f9a98f0

Please sign in to comment.