-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
41 lines (35 loc) · 839 Bytes
/
main.c
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
/**
* Copyright (c) Project Iota
*
* WeIO_firmware is licensed under an Apache license, version 2.0 license.
* All rights not explicitly granted in the Apache license, version 2.0 are reserved.
* See the included LICENSE file for more details.
*
* @author Paul Rathgeb <[email protected]>
*/
#include "global.h"
#include "periph/gpio.h"
#ifdef USE_USB
# include "usb_enum.h"
# include "IAP.h"
uint32_t GUID[4];
#endif
int main(void)
{
#ifdef USE_USB
IAP_GetSerialNumber(GUID);
CDC_Init(GUID);
USBRegisterStream(&stream);
#endif
RegisterFunctions();
uint8_t size = 0;
char buf[64];
while(1) {
size = stream.available();
if (size) {
stream.read((uint8_t*)&buf, size);
erpcCall((char*)&buf, size);
}
}
return 0;
}