wip:
This commit is contained in:
@@ -1 +1 @@
|
||||
idf_component_register(SRCS "main.c" INCLUDE_DIRS "include")
|
||||
idf_component_register(SRCS "zh_encoder.c" INCLUDE_DIRS "include" REQUIRES driver)
|
||||
15
include/zh_encoder.h
Normal file
15
include/zh_encoder.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include "esp_log.h"
|
||||
#include "driver/gpio.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1 @@
|
||||
1.0.0
|
||||
15
zh_encoder.c
Normal file
15
zh_encoder.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "zh_encoder.h"
|
||||
|
||||
static const char *TAG = "zh_encoder";
|
||||
|
||||
#define ZH_CD74HC4067_LOGI(msg, ...) ESP_LOGI(TAG, msg, ##__VA_ARGS__)
|
||||
#define ZH_CD74HC4067_LOGW(msg, ...) ESP_LOGW(TAG, msg, ##__VA_ARGS__)
|
||||
#define ZH_CD74HC4067_LOGE(msg, ...) ESP_LOGE(TAG, msg, ##__VA_ARGS__)
|
||||
#define ZH_CD74HC4067_LOGE_ERR(msg, err, ...) ESP_LOGE(TAG, "[%s:%d:%s] " msg, __FILE__, __LINE__, esp_err_to_name(err), ##__VA_ARGS__)
|
||||
|
||||
#define ZH_CD74HC4067_CHECK(cond, err, msg, ...) \
|
||||
if (!(cond)) \
|
||||
{ \
|
||||
ZH_CD74HC4067_LOGE_ERR(msg, err); \
|
||||
return err; \
|
||||
}
|
||||
Reference in New Issue
Block a user