This commit is contained in:
2025-06-07 12:50:26 +03:00
parent c1246caa87
commit ff58109ff8
6 changed files with 32 additions and 1 deletions

View File

@@ -1 +1 @@
idf_component_register(SRCS "main.c" INCLUDE_DIRS "include") idf_component_register(SRCS "zh_encoder.c" INCLUDE_DIRS "include" REQUIRES driver)

View File

15
include/zh_encoder.h Normal file
View File

@@ -0,0 +1,15 @@
#pragma once
#include "esp_log.h"
#include "driver/gpio.h"
#ifdef __cplusplus
extern "C"
{
#endif
#ifdef __cplusplus
}
#endif

0
main.c
View File

View File

@@ -0,0 +1 @@
1.0.0

15
zh_encoder.c Normal file
View 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; \
}