-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_format_sample.c
80 lines (66 loc) · 1.18 KB
/
data_format_sample.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include <stdint.h>
#include <stdint.h>
#define SL_UNUSED_PARAMETER(param) (void) (param)
const unsigned int SL_MAX_UART_CONNECTIONS = 3;
uint8_t sl_uart_char;
typedef enum {
SL_CARD_SPADE,
SL_CARD_HEART,
SL_CARD_CLUB,
SL_CARD_DIAMOND
} sl_card_suit_t;
typedef struct {
uint32_t hour;
uint32_t minute;
uint32_t second;
} sl_time_t;
sl_time_t sl_time;
void sl_do_something(uint8_t bar)
{
// uint8_t arr[100]; //magic number
uint8_t foo = 1;
if (foo > bar) { // The preceding brace is *required*
do_this();
} else if (foo < bar) {
do_that();
} else {
do_another_thing();
}
if (foo > bar) {
do_this();
}
while (1) {
}
do {
sli_do_work();
} while (foo);
switch (bar) {
case 1:
sli_do_this();
break;
case 2:
sli_do_that();
break;
case 3:
{
sli_do_the_other_thing();
break;
}
case 0:
default:
sli_do_what();
break;
}
}
void sl_do_something2(int a,
int b,
int c,
const char *string1,
const char *string2)
{
// ...
}
void sli_do_something(int a, int b, int c)
{
// ...
}