-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmain.cpp
More file actions
46 lines (42 loc) · 797 Bytes
/
Copy pathmain.cpp
File metadata and controls
46 lines (42 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <stdio.h>
#include "freedeck.hpp"
#include "freedeck_serial.hpp"
#include "hardware/gpio.h"
#include "hardware/i2c.h"
#include "pico/multicore.h"
#include "pico/stdlib.h"
#include <bsp/board.h>
#include <fd_usb.hpp>
#include <init.hpp>
#include <logo.hpp>
#include <settings.hpp>
#include <util.hpp>
void setup() {
stdio_init_all();
init_mux();
init_button();
init_oleds(OLED_SPEED, PRE_CHARGE_PERIOD, REFRESH_FREQUENCY);
init_sdcard();
init_usb();
post_setup();
}
void main_loop() {
while (true) {
cdc_task();
sleep_task();
for (uint8_t i = 0; i < BD_COUNT; i++) {
check_button_state(i);
}
}
}
void loop_usb() {
while (true) {
process_usb();
}
}
int main() {
setup();
multicore_launch_core1(main_loop);
loop_usb();
return 0;
}