Created
October 3, 2020 12:05
-
-
Save sepfy/d43a22080cf99e008cce4af377398dd6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static ssize_t attr_store(struct device *dev, | |
struct device_attribute *attr, | |
const char *buf, size_t count) | |
{ | |
printk("[%s][%d]\n", __func__, __LINE__); | |
buzzer_trigger = simple_strtoul(buf, NULL, 10); | |
gpio_set_value(BUZZER, buzzer_trigger); | |
return count; | |
} | |
static ssize_t attr_show(struct device *dev, | |
struct device_attribute *attr, | |
char *buf) | |
{ | |
int val = 0; | |
printk("[%s][%d]\n", __func__, __LINE__); | |
val = sprintf(buf, "%d\n", buzzer_trigger); | |
return val; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment