File tree Expand file tree Collapse file tree 5 files changed +59
-0
lines changed
examples/tutorials/thread_network Expand file tree Collapse file tree 5 files changed +59
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Makefile for user application
2
+
3
+ # Specify this directory relative to the current application.
4
+ TOCK_USERLAND_BASE_DIR = ../../../../
5
+
6
+ # Which files to compile.
7
+ C_SRCS := $(wildcard * .c)
8
+
9
+ PACKAGE_NAME = screen
10
+
11
+ # Include userland master makefile. Contains rules and flags for actually
12
+ # building the application.
13
+ include $(TOCK_USERLAND_BASE_DIR ) /AppMakefile.mk
Original file line number Diff line number Diff line change
1
+ #include <stdbool.h>
2
+ #include <stdint.h>
3
+ #include <stdio.h>
4
+ #include <string.h>
5
+
6
+ int main (void ) {
7
+
8
+ }
Original file line number Diff line number Diff line change
1
+ # Makefile for user application
2
+
3
+ # Specify this directory relative to the current application.
4
+ TOCK_USERLAND_BASE_DIR = ../../../../
5
+
6
+ # Which files to compile.
7
+ C_SRCS := $(wildcard * .c)
8
+
9
+ PACKAGE_NAME = screen
10
+
11
+ # Include userland master makefile. Contains rules and flags for actually
12
+ # building the application.
13
+ include $(TOCK_USERLAND_BASE_DIR ) /AppMakefile.mk
Original file line number Diff line number Diff line change
1
+ #include <stdbool.h>
2
+ #include <stdint.h>
3
+ #include <stdio.h>
4
+ #include <string.h>
5
+
6
+ #include <libtock/interface/button.h>
7
+
8
+ static void button_callback (returncode_t ret ,
9
+ int btn_num ,
10
+ bool pressed ) {
11
+
12
+ if (pressed ) {
13
+ printf ("Button %i pressed!\r\n" , btn_num );
14
+ }
15
+ }
16
+
17
+ int main (void ) {
18
+ for (int i = 0 ; i < 4 ; i ++ ){
19
+ libtock_button_notify_on_press (i , button_callback );
20
+ }
21
+
22
+ for (;;) {
23
+ yield ();
24
+ }
25
+ }
You can’t perform that action at this time.
0 commit comments