samples: hid: Use new logger

Use new USB logger with function names.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
Andrei Emeltchenko 2018-10-10 15:48:13 +03:00 committed by Anas Nashif
commit 47be332b79

View file

@ -4,16 +4,15 @@
* SPDX-License-Identifier: Apache-2.0
*/
#define SYS_LOG_LEVEL 4
#define SYS_LOG_DOMAIN "main"
#include <logging/sys_log.h>
#include <zephyr.h>
#include <init.h>
#include <usb/usb_device.h>
#include <usb/class/usb_hid.h>
#define LOG_LEVEL LOG_LEVEL_DBG
LOG_MODULE_REGISTER(main)
#define REPORT_ID_1 0x01
#define REPORT_ID_2 0x02
@ -60,7 +59,7 @@ static const u8_t hid_report_desc[] = {
static int debug_cb(struct usb_setup_packet *setup, s32_t *len,
u8_t **data)
{
SYS_LOG_DBG("Debug callback");
USB_DBG("Debug callback");
return -ENOTSUP;
}
@ -68,7 +67,7 @@ static int debug_cb(struct usb_setup_packet *setup, s32_t *len,
static int set_idle_cb(struct usb_setup_packet *setup, s32_t *len,
u8_t **data)
{
SYS_LOG_DBG("Set Idle callback");
USB_DBG("Set Idle callback");
/* TODO: Do something */
@ -78,7 +77,7 @@ static int set_idle_cb(struct usb_setup_packet *setup, s32_t *len,
static int get_report_cb(struct usb_setup_packet *setup, s32_t *len,
u8_t **data)
{
SYS_LOG_DBG("Get report callback");
USB_DBG("Get report callback");
/* TODO: Do something */
@ -92,7 +91,7 @@ static void send_report(struct k_work *work)
ret = hid_int_ep_write(report_1, sizeof(report_1), &wrote);
SYS_LOG_DBG("Wrote %d bytes with ret %d", wrote, ret);
USB_DBG("Wrote %d bytes with ret %d", wrote, ret);
/* Increment reported data */
report_1[1]++;
@ -110,7 +109,7 @@ static void status_cb(enum usb_dc_status_code status, const u8_t *param)
in_ready_cb();
break;
default:
SYS_LOG_DBG("status %u unhandled", status);
USB_DBG("status %u unhandled", status);
break;
}
}
@ -128,7 +127,7 @@ static const struct hid_ops ops = {
void main(void)
{
SYS_LOG_DBG("Starting application");
USB_DBG("Starting application");
k_delayed_work_init(&delayed_report_send, send_report);