Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
# Copyright (c) 2021 Brian Bradley

cmake_minimum_required(VERSION 3.20.0)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
list (APPEND SYSCALL_INCLUDE_DIRS
${CMAKE_SOURCE_DIR}/../extras/drivers/wii
)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

project(shredlink LANGUAGES C VERSION 0.2.0)
Expand Down
2 changes: 1 addition & 1 deletion app/include/shredlink/daq.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#ifndef __SHREDLINK_POLLER_H
#define __SHREDLINK_POLLER_H

#include <zephyr.h>
#include <zephyr/kernel.h>

/**
* @TODO: this should be configurable and part of the gamepad API
Expand Down
10 changes: 5 additions & 5 deletions app/src/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* SPDX-License-Identifier: Apache-2.0
*
*/
#include <zephyr.h>
#include <device.h>
#include <logging/log.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/logging/log.h>
#include <shredlink/hid.h>
#include <usb/usb_device.h>
#include <usb/class/usb_hid.h>
#include <zephyr/usb/usb_device.h>
#include <zephyr/usb/class/usb_hid.h>

LOG_MODULE_DECLARE(shredlink, CONFIG_SHREDLINK_LOG_LEVEL);

Expand Down
4 changes: 2 additions & 2 deletions app/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
*
*/

#include <zephyr.h>
#include <logging/log.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <app_version.h>

LOG_MODULE_REGISTER(shredlink, CONFIG_SHREDLINK_LOG_LEVEL);
Expand Down
7 changes: 3 additions & 4 deletions app/src/polling.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
* SPDX-License-Identifier: Apache-2.0
*
*/
#include <zephyr.h>
#include <zephyr/kernel.h>
#include <wii.h>
#include <device.h>
#include <sys/util.h>
#include <logging/log.h>
#include <zephyr/sys/util.h>
#include <zephyr/logging/log.h>
#include <shredlink/daq.h>
#include <shredlink/hid.h>

Expand Down
8 changes: 4 additions & 4 deletions app/src/tilt.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
* SPDX-License-Identifier: Apache-2.0
*
*/
#include <zephyr.h>
#include <logging/log.h>
#include <device.h>
#include <drivers/sensor.h>
#include <zephyr/zephyr.h>
#include <zephyr/logging/log.h>
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <drivers/sensor/tilt.h>
#include <shredlink/daq.h>

Expand Down
10 changes: 3 additions & 7 deletions extras/drivers/sensor/tilt/gpio/src/gpio_tilt.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#define DT_DRV_COMPAT gpio_tilt

#include <errno.h>
#include <zephyr.h>
#include <logging/log.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <drivers/sensor/tilt.h>
#include "gpio_tilt.h"

Expand Down Expand Up @@ -82,10 +82,6 @@ static struct gpio_tilt_data gpio_tilt_data = {
.sensor = GPIO_DT_SPEC_INST_GET(0, tilt_gpios),
};

static const struct gpio_tilt_config gpio_tilt_cfg = {
.tilt_controller = DT_INST_GPIO_LABEL(0, tilt_gpios),
};

DEVICE_DT_INST_DEFINE(0, gpio_tilt_init, NULL,
&gpio_tilt_data, &gpio_tilt_cfg, POST_KERNEL,
&gpio_tilt_data, NULL, POST_KERNEL,
CONFIG_SENSOR_INIT_PRIORITY, &gpio_tilt_api_funcs);
12 changes: 4 additions & 8 deletions extras/drivers/sensor/tilt/gpio/src/gpio_tilt.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

#include <errno.h>
#include <zephyr/types.h>
#include <device.h>
#include <drivers/sensor.h>
#include <sys/util.h>
#include <drivers/gpio.h>
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/sys/util.h>
#include <zephyr/drivers/gpio.h>

struct gpio_tilt_data {
struct gpio_dt_spec sensor;
Expand All @@ -30,10 +30,6 @@ struct gpio_tilt_data {
#endif
};

struct gpio_tilt_config {
const char *tilt_controller;
};

#ifdef CONFIG_TILT_SENSOR_TRIGGER
int gpio_tilt_trigger_set(const struct device *dev,
const struct sensor_trigger *trig,
Expand Down
4 changes: 2 additions & 2 deletions extras/drivers/sensor/tilt/gpio/src/gpio_tilt_triggers.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
*
*/

#include <zephyr.h>
#include <zephyr/kernel.h>
#include "gpio_tilt.h"
#include <logging/log.h>
#include <zephyr/logging/log.h>

LOG_MODULE_DECLARE(tilt_gpio, CONFIG_SENSOR_LOG_LEVEL);

Expand Down
3 changes: 2 additions & 1 deletion extras/drivers/wii/include/wii.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
#define SHREDLINK_DRIVERS_SENSOR_NINTENDO_WII_H_

#include <zephyr/types.h>
#include <device.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>

#ifdef __cplusplus
extern "C" {
Expand Down
15 changes: 7 additions & 8 deletions extras/drivers/wii/src/wii_peripheral.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
#define DT_DRV_COMPAT nintendo_wii

#include <errno.h>
#include <zephyr.h>
#include <device.h>
#include <kernel.h>
#include <drivers/i2c.h>
#include <init.h>
#include <sys/__assert.h>
#include <logging/log.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/i2c.h>
#include <zephyr/init.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/logging/log.h>
#include <wii.h>
#include <sys/byteorder.h>
#include <zephyr/sys/byteorder.h>

LOG_MODULE_REGISTER(wii, CONFIG_WII_LOG_LEVEL);

Expand Down
2 changes: 1 addition & 1 deletion extras/include/drivers/sensor/tilt.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
extern "C" {
#endif

#include <drivers/sensor.h>
#include <zephyr/drivers/sensor.h>

enum sensor_channel_tilt {
/**
Expand Down
6 changes: 3 additions & 3 deletions samples/tilt_sensor/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
*
*/

#include <zephyr.h>
#include <drivers/sensor.h>
#include <zephyr/kernel.h>
#include <zephyr/drivers/sensor.h>
#include <drivers/sensor/tilt.h>
#include <drivers/gpio.h>
#include <zephyr/drivers/gpio.h>

#define LED_ID DT_ALIAS(led0)
#define TILT_SENSOR DT_NODELABEL(tilt0)
Expand Down
8 changes: 4 additions & 4 deletions samples/wii_guitar/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
*
*/

#include <zephyr.h>
#include <zephyr/kernel.h>
#include <wii.h>
#include <string.h>

#define WII_GUITAR DT_LABEL(DT_NODELABEL(wii_guitar))
#define WII_GUITAR DT_NODELABEL(wii_guitar)

struct __attribute__((packed)) guitar_data{
uint8_t analog_x: 6;
Expand All @@ -37,9 +37,9 @@ void main(void)
const struct device *wii;
int ret;

wii = device_get_binding(WII_GUITAR);
wii = DEVICE_DT_GET(WII_GUITAR);
if (wii == NULL) {
printk("Error getting device: %s\n", WII_GUITAR);
printk("Error getting device");
}

while (1) {
Expand Down
12 changes: 6 additions & 6 deletions tests/tilt/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
*
*/

#include <zephyr.h>
#include <ztest.h>
#include <drivers/sensor.h>
#include <zephyr/kernel.h>
#include <zephyr/ztest.h>
#include <zephyr/drivers/sensor.h>
#include <drivers/sensor/tilt.h>

#define TILT_SENSOR_LABEL DT_LABEL(DT_NODELABEL(tilt0))
#define TILT_SENSOR DT_NODELABEL(tilt0)
const struct device *get_tilt_sensor_device(void){
const struct device * dev = device_get_binding(TILT_SENSOR_LABEL);
zassert_not_null(dev, "failed: dev '%s' is null", TILT_SENSOR_LABEL);
const struct device * dev = DEVICE_DT_GET(TILT_SENSOR);
zassert_not_null(dev, "failed: No tilt device");
return dev;
}

Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ manifest:
projects:
- name: zephyr
remote: zephyrproject-rtos
revision: zephyr-v3.0.0
revision: zephyr-v3.2.0
import:
path-prefix: rtos