Skip to content

Commit

Permalink
examples: update header locations
Browse files Browse the repository at this point in the history
  • Loading branch information
bradjc committed Feb 9, 2024
1 parent bd32d3c commit ff8a8dd
Show file tree
Hide file tree
Showing 35 changed files with 104 additions and 95 deletions.
4 changes: 2 additions & 2 deletions examples/accel-leds/main.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <limits.h>
#include <stdio.h>

#include <led.h>
#include <ninedof.h>
#include <interface/led.h>
#include <sensors/ninedof.h>

int main(void) {
printf("[App] Accelerometer -> LEDs\n");
Expand Down
3 changes: 2 additions & 1 deletion examples/adc/main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <adc.h>
#include <stdio.h>

#include <peripherals/adc.h>
#include <timer.h>

int main(void) {
Expand Down
2 changes: 1 addition & 1 deletion examples/ble-uart/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <nrf51_serialization.h>

#include <console.h>
#include <interface/console.h>
#include <tock.h>

#include "ble_nus.h"
Expand Down
6 changes: 4 additions & 2 deletions examples/ble_advertising/main.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#include <ble.h>
#include <gap.h>
#include <stdbool.h>
#include <stdio.h>

#include <gap.h>

#include <net/ble.h>
#include <tock.h>

// Sizes in bytes
Expand Down
6 changes: 4 additions & 2 deletions examples/ble_passive_scanning/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#include <stdio.h>

#include <net/ble.h>

#include "advertisement.h"
#include "advertisement_list.h"
#include <ble.h>
#include <stdio.h>

/*
* BLE Demo Application
Expand Down
2 changes: 1 addition & 1 deletion examples/blink/main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <led.h>
#include <interface/led.h>
#include <timer.h>

int main(void) {
Expand Down
4 changes: 2 additions & 2 deletions examples/buttons/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
// button is pressed, the first LED is toggled. If the third button is pressed,
// the third LED is toggled.

#include <button.h>
#include <led.h>
#include <interface/button.h>
#include <interface/led.h>

// Callback for button presses.
// btn_num: The index of the button associated with the callback
Expand Down
2 changes: 1 addition & 1 deletion examples/c_hello/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <string.h>
#include <unistd.h>

#include <console.h>
#include <interface/console.h>

char hello[] = "Hello World!\r\n";

Expand Down
4 changes: 2 additions & 2 deletions examples/find_north/main.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <math.h>
#include <stdio.h>

#include <led.h>
#include <ninedof.h>
#include <interface/led.h>
#include <sensors/ninedof.h>

int main(void) {
int x, y, z;
Expand Down
4 changes: 2 additions & 2 deletions examples/i2c-usb-bridge/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include <string.h>
#include <unistd.h>

#include <console.h>
#include <i2c_master.h>
#include <interface/console.h>
#include <peripherals/i2c_master.h>

#define DATA_LEN 64

Expand Down
10 changes: 5 additions & 5 deletions examples/ip_sense/main.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include <stdbool.h>
#include <stdio.h>

#include <ambient_light.h>
#include <humidity.h>
#include <temperature.h>
#include <sensors/ambient_light.h>
#include <sensors/humidity.h>
#include <sensors/temperature.h>
#include <timer.h>

#include <ieee802154.h>
#include <udp.h>
#include <net/ieee802154.h>
#include <net/udp.h>

static unsigned char BUF_BIND_CFG[2 * sizeof(sock_addr_t)];

Expand Down
4 changes: 0 additions & 4 deletions examples/lora/sensor-receive/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
// include the hardware abstraction layer
#include "libtockHal.h"

// Include some libtock-c helpers
#include <humidity.h>
#include <temperature.h>

#define BUFFER_LEN 64

// the entry point for the program
Expand Down
4 changes: 2 additions & 2 deletions examples/lora/sensor-transmit/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "libtockHal.h"

// Include some libtock-c helpers
#include <humidity.h>
#include <temperature.h>
#include <sensors/humidity.h>
#include <sensors/temperature.h>

#define BUFFER_LEN 64

Expand Down
4 changes: 2 additions & 2 deletions examples/rot13_client/main.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <stdio.h>
#include <string.h>
#include <timer.h>

#include <ipc.h>
#include <kernel/ipc.h>
#include <timer.h>

size_t rot13_svc_num = 0;

Expand Down
2 changes: 1 addition & 1 deletion examples/rot13_service/main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <ipc.h>
#include <kernel/ipc.h>
#include <tock.h>

struct rot13_buf {
Expand Down
2 changes: 1 addition & 1 deletion examples/rtc_app/main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <rtc.h>
#include <peripheral/rtc.h>
#include <stdio.h>
#include <timer.h>

Expand Down
3 changes: 2 additions & 1 deletion examples/screen/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <screen.h>
#include <stdio.h>
#include <stdlib.h>

#include <display/screen.h>
#include <timer.h>

#define BUFFER_SIZE 10 * 1024
Expand Down
8 changes: 4 additions & 4 deletions examples/security_app/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#include <stdint.h>
#include <stdio.h>

#include "console.h"
#include "gpio.h"
#include "led.h"
#include "tock.h"
#include <interface/console.h>
#include <interface/led.h>
#include <peripherals/gpio.h>
#include <tock.h>

typedef struct {
uint8_t pir;
Expand Down
16 changes: 8 additions & 8 deletions examples/sensors/main.c
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#include <stdbool.h>
#include <stdio.h>

#include <ambient_light.h>
#include <humidity.h>
#include <lps25hb.h>
#include <ninedof.h>
#include <proximity.h>
#include <sound_pressure.h>
#include <temperature.h>
#include <chips/lps25hb.h>
#include <chips/tsl2561.h>
#include <sensors/ambient_light.h>
#include <sensors/humidity.h>
#include <sensors/ninedof.h>
#include <sensors/proximity.h>
#include <sensors/sound_pressure.h>
#include <sensors/temperature.h>
#include <timer.h>
#include <tock.h>
#include <tsl2561.h>

static tock_timer_t timer;
static bool light = false;
Expand Down
6 changes: 3 additions & 3 deletions examples/services/ble-env-sense/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

#include <ble_advdata.h>
#include <nordic_common.h>
#include <nrf.h>
#include <nrf_error.h>

#include <eddystone.h>
#include <simple_adv.h>
#include <simple_ble.h>

#include <ipc.h>
#include <nrf.h>
#include <nrf51_serialization.h>
#include <kernel/ipc.h>
#include <net/nrf51_serialization.h>
#include <tock.h>

#include "env_sense_service.h"
Expand Down
5 changes: 3 additions & 2 deletions examples/touch/main.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#include <screen.h>
#include <stdio.h>
#include <stdlib.h>

#include <display/screen.h>
#include <sensor/touch.h>
#include <timer.h>
#include <touch.h>

static void touch_event (int status, int x, int y, void *ud __attribute__ ((unused))) {
switch (status) {
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorials/02_button_print/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <stdio.h>

#include <button.h>
#include <interface/button.h>

// Callback for button presses.
// btn_num: The index of the button associated with the callback
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorials/03_ble_scan/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Included in the libnrfserialization.a library.
#include <simple_ble.h>

#include <led.h>
#include <interface/led.h>

/*******************************************************************************
* BLE
Expand Down
4 changes: 2 additions & 2 deletions examples/tutorials/05_ipc/led/main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <ipc.h>
#include <led.h>
#include <interface/led.h>
#include <kernel/ipc.h>
#include <tock.h>

// This service can control the LEDs on a board.
Expand Down
3 changes: 2 additions & 1 deletion examples/tutorials/05_ipc/logic/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <ipc.h>
#include <stdio.h>
#include <string.h>

#include <kernel/ipc.h>
#include <timer.h>

// Every 500 ms use the RNG service to randomly select an LED to turn on or
Expand Down
4 changes: 2 additions & 2 deletions examples/tutorials/05_ipc/rng/main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <ipc.h>
#include <rng.h>
#include <kernel/ipc.h>
#include <peripherals/rng.h>
#include <tock.h>

// Random Number Generator Service
Expand Down
12 changes: 6 additions & 6 deletions examples/tutorials/hotp/hotp_milestone_one/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
#include <string.h>

// Libtock includes
#include <app_state.h>
#include <button.h>
#include <console.h>
#include <hmac.h>
#include <led.h>
#include <crypto/hmac.h>
#include <interface/button.h>
#include <interface/console.h>
#include <interface/led.h>
#include <interface/usb_keyboard_hid.h>
#include <storage/app_state.h>
#include <timer.h>
#include <usb_keyboard_hid.h>

// Local includes
#include "base32.h"
Expand Down
12 changes: 6 additions & 6 deletions examples/tutorials/hotp/hotp_milestone_three/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
#include <string.h>

// Libtock includes
#include <app_state.h>
#include <button.h>
#include <console.h>
#include <hmac.h>
#include <led.h>
#include <crypto/hmac.h>
#include <interface/button.h>
#include <interface/console.h>
#include <interface/led.h>
#include <interface/usb_keyboard_hid.h>
#include <storage/app_state.h>
#include <timer.h>
#include <usb_keyboard_hid.h>

// Local includes
#include "base32.h"
Expand Down
12 changes: 6 additions & 6 deletions examples/tutorials/hotp/hotp_milestone_two/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
#include <string.h>

// Libtock includes
#include <app_state.h>
#include <button.h>
#include <console.h>
#include <hmac.h>
#include <led.h>
#include <crypto/hmac.h>
#include <interface/button.h>
#include <interface/console.h>
#include <interface/led.h>
#include <interface/usb_keyboard_hid.h>
#include <storage/app_state.h>
#include <timer.h>
#include <usb_keyboard_hid.h>

// Local includes
#include "base32.h"
Expand Down
12 changes: 6 additions & 6 deletions examples/tutorials/hotp/hotp_oracle_complete/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
#include <string.h>

// Libtock includes
#include <button.h>
#include <console.h>
#include <hmac.h>
#include <kv.h>
#include <led.h>
#include <crypto/hmac.h>
#include <interface/button.h>
#include <interface/console.h>
#include <interface/led.h>
#include <interface/usb_keyboard_hid.h>
#include <storage/app_state.h>
#include <timer.h>
#include <usb_keyboard_hid.h>

// Local includes
#include "base32.h"
Expand Down
12 changes: 6 additions & 6 deletions examples/tutorials/hotp/hotp_starter/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
#include <string.h>

// Libtock includes
#include <app_state.h>
#include <button.h>
#include <console.h>
#include <hmac.h>
#include <led.h>
#include <crypto/hmac.h>
#include <interface/button.h>
#include <interface/console.h>
#include <interface/led.h>
#include <interface/usb_keyboard_hid.h>
#include <storage/app_state.h>
#include <timer.h>
#include <usb_keyboard_hid.h>

// Local includes
#include "base32.h"
Expand Down
Loading

0 comments on commit ff8a8dd

Please sign in to comment.