【萌新】D1H如何使用硬件定时器?
-
想使用硬件定时器输出步进电机的脉冲,我看D1H的用户手册是有这个功能的(手册里提供了直接操作寄存器的代码例子),但是不太明白如何在应用层调用,是否是没有对应的驱动?
网上查找了一些定时器相关的代码,编译报错找不到头文件/home/ubt/tina-d1-h/prebuilt/gcc/linux-x86/riscv/toolchain-thead-glibc/riscv64-glibc-gcc-thead_20200702/bin/riscv64-unknown-linux-gnu-gcc -o timer timer.c timer.c:14:10: fatal error: linux/timer.h: No such file or directory #include <linux/timer.h>
我看了下在tina-d1-h\lichee\linux-5.4\include\linux这个目录下是有timer.h这个头文件的,但是没有高精度定时器hrtimer.h的文件
之前基本只搞过单片机裸板开发,linux驱动/应用开发都还在学习中,现在是搞不太明白,还望大佬指点 -
在out目录下搜索存在hrtimer.h文件,但是该如何调用?
是menuconfig中有timer的相关配置需要开启吗 -
config-5.4文件搜索timer配置如下
# # Timers subsystem # CONFIG_TICK_ONESHOT=y CONFIG_NO_HZ_COMMON=y # CONFIG_HZ_PERIODIC is not set CONFIG_NO_HZ_IDLE=y CONFIG_NO_HZ=y CONFIG_HIGH_RES_TIMERS=y # end of Timers subsystem # # Clock Source drivers # CONFIG_TIMER_OF=y CONFIG_TIMER_PROBE=y CONFIG_CLKSRC_MMIO=y CONFIG_SUN4I_TIMER=y # CONFIG_SUN50I_TIMER is not set # CONFIG_SUNXI_TIMER is not set # CONFIG_SUNXI_TIMER_TEST is not set # CONFIG_MTK_TIMER is not set CONFIG_RISCV_TIMER=y # end of Clock Source drivers
看起来也都是开启的,就是不知道咋用
-
include 的路径对吗,加入了-I 的头文件指定路径吗,或者KERNEL的prefix对吗
-
@yuzukitsuru 代码头文件是这样的
#include <linux/module.h> #include <linux/kernel.h> #include <linux/hrtimer.h> #include <linux/jiffies.h>
makefile没有加-l指定路径
#设置编译链路径及工具 CTOOL := riscv64-unknown-linux-gnu- CCL := /home/ubt/tina-d1-h/prebuilt/gcc/linux-x86/riscv/toolchain-thead-glibc/riscv64-glibc-gcc-thead_20200702 CC := ${CCL}/bin/${CTOOL}gcc #设置编译规则 timer:timer.c ${CC} -o timer timer.c #清理规则 clean: rm timer
但是编译时没有报错找不到module.h或者kernel.h
prefix不太清楚我去找一下
-
想参考下头文件路径该指定哪里
搜索了package下的文件,都没有调用timer的;
直接搜索整个SDK太大了,在out目录下找到很多,但这里似乎只是存放各种板型生成文件的地方没啥用
总之还是没解决 -
@allwinner_account 可以参考这个 https://v853.docs.aw-ol.com/soft/dev_gpio/#linux-led 编写一个kernel驱动即可
-
@yuzukitsuru 好的感谢回复,我以为可以不用写驱动来着
-
还是尝试找了下头文件位置,参考linux内核目录介绍和搜索功能,添加了一些路径
# build pulse executable when user executes “make” pulse: pulse.o $(CC) $(LDFLAGS) pulse.o -o pulse ABS_PATH = /home/ubt/tina-d1-h/lichee/linux-5.4/ # linux/xxx路径 -I/home/ubt/tina-d1-h/lichee/linux-5.4/include/ # uapi/xxx路径 -I/home/ubt/tina-d1-h/lichee/linux-5.4/ # asm/xxx路径 -I/home/ubt/tina-d1-h/lichee/linux-5.4/arch/riscv/include # asm/xxx路径2 -I/home/ubt/tina-d1-h/lichee/linux-5.4/arch/riscv/include/generated # linux/xxx路径2-I/home/ubt/tina-d1-h/lichee/linux-5.4/include/uapi/ INC = -I$(ABS_PATH) -I$(ABS_PATH)include/ -I$(ABS_PATH)arch/riscv/include/ -I$(ABS_PATH)/arch/riscv/include/generated/ -I$(ABS_PATH)include/uapi/ pulse.o: pulse.c $(CC) $(CFLAGS) $(INC) -c pulse.c # remove object files and executable when user executes “make clean” clean: rm *.o pulse
编译出现了大量错误
/home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:68:1: warning: empty declaration [enabled by default] struct pcpu_group_info { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:75:1: warning: empty declaration [enabled by default] struct pcpu_alloc_info { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:87:1: warning: empty declaration [enabled by default] enum pcpu_fc { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:94:27: error: storage class specified for parameter ‘pcpu_fc_names’ extern const char * const pcpu_fc_names[PCPU_FC_NR]; ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:96:21: error: storage class specified for parameter ‘pcpu_chosen_fc’ extern enum pcpu_fc pcpu_chosen_fc; ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:98:18: error: storage class specified for parameter ‘pcpu_fc_alloc_fn_t’ typedef void * (*pcpu_fc_alloc_fn_t)(unsigned int cpu, size_t size, ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:100:16: error: storage class specified for parameter ‘pcpu_fc_free_fn_t’ typedef void (*pcpu_fc_free_fn_t)(void *ptr, size_t size); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:101:16: error: storage class specified for parameter ‘pcpu_fc_populate_pte_fn_t’ typedef void (*pcpu_fc_populate_pte_fn_t)(unsigned long addr); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:102:14: error: storage class specified for parameter ‘pcpu_fc_cpu_distance_fn_t’ typedef int (pcpu_fc_cpu_distance_fn_t)(unsigned int from, unsigned int to); ^ In file included from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/printk.h:6:0, from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/kernel.h:15, from pulse.c:14: /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/init.h:50:27: error: expected declaration specifiers or ‘...’ before ‘.’ token #define __init __section(.init.text) __cold __latent_entropy __noinitretpoline __nocfi ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:104:33: note: in expansion of macro ‘__init’ extern struct pcpu_alloc_info * __init pcpu_alloc_alloc_info(int nr_groups, ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/init.h:50:27: error: expected declaration specifiers or ‘...’ before ‘.’ token #define __init __section(.init.text) __cold __latent_entropy __noinitretpoline __nocfi ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:106:13: note: in expansion of macro ‘__init’ extern void __init pcpu_free_alloc_info(struct pcpu_alloc_info *ai); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/init.h:50:27: error: expected declaration specifiers or ‘...’ before ‘.’ token #define __init __section(.init.text) __cold __latent_entropy __noinitretpoline __nocfi ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:108:13: note: in expansion of macro ‘__init’ extern void __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai, ^ In file included from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:19:0, from pulse.c:16: /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:126:23: error: storage class specified for parameter ‘__alloc_reserved_percpu’ extern void __percpu *__alloc_reserved_percpu(size_t size, size_t align); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:127:13: error: storage class specified for parameter ‘__is_kernel_percpu_address’ extern bool __is_kernel_percpu_address(unsigned long addr, unsigned long *can_addr); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:128:13: error: storage class specified for parameter ‘is_kernel_percpu_address’ extern bool is_kernel_percpu_address(unsigned long addr); ^ In file included from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/printk.h:6:0, from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/kernel.h:15, from pulse.c:14: /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/init.h:50:27: error: expected declaration specifiers or ‘...’ before ‘.’ token #define __init __section(.init.text) __cold __latent_entropy __noinitretpoline __nocfi ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:131:13: note: in expansion of macro ‘__init’ extern void __init setup_per_cpu_areas(void); ^ In file included from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:19:0, from pulse.c:16: /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:134:23: error: storage class specified for parameter ‘__alloc_percpu_gfp’ extern void __percpu *__alloc_percpu_gfp(size_t size, size_t align, gfp_t gfp); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:135:23: error: storage class specified for parameter ‘__alloc_percpu’ extern void __percpu *__alloc_percpu(size_t size, size_t align); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:136:13: error: storage class specified for parameter ‘free_percpu’ extern void free_percpu(void __percpu *__pdata); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:137:20: error: storage class specified for parameter ‘per_cpu_ptr_to_phys’ extern phys_addr_t per_cpu_ptr_to_phys(void *addr); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:146:22: error: storage class specified for parameter ‘pcpu_nr_pages’ extern unsigned long pcpu_nr_pages(void); ^ In file included from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:21:0, from pulse.c:16: /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:11:2: error: expected specifier-qualifier-list before ‘ktime_t’ ktime_t expires; ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:9:1: warning: empty declaration [enabled by default] struct timerqueue_node { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:14:1: warning: empty declaration [enabled by default] struct timerqueue_head { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:19:13: error: storage class specified for parameter ‘timerqueue_add’ extern bool timerqueue_add(struct timerqueue_head *head, ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:21:13: error: storage class specified for parameter ‘timerqueue_del’ extern bool timerqueue_del(struct timerqueue_head *head, ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:23:32: error: storage class specified for parameter ‘timerqueue_iterate_next’ extern struct timerqueue_node *timerqueue_iterate_next( ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:35:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:42:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:47:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:52:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/timerqueue.h:57:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token { ^ In file included from pulse.c:16:0: /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:24:1: warning: empty declaration [enabled by default] struct hrtimer_clock_base; ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:25:1: warning: empty declaration [enabled by default] struct hrtimer_cpu_base; ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:39:1: warning: empty declaration [enabled by default] enum hrtimer_mode { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:65:1: warning: empty declaration [enabled by default] enum hrtimer_restart { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:120:2: error: expected specifier-qualifier-list before ‘ktime_t’ ktime_t _softexpires; ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:118:1: warning: empty declaration [enabled by default] struct hrtimer { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:138:1: warning: empty declaration [enabled by default] struct hrtimer_sleeper { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:165:2: error: expected specifier-qualifier-list before ‘seqcount_t’ seqcount_t seq; ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:161:1: warning: empty declaration [enabled by default] struct hrtimer_clock_base { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:172:1: warning: empty declaration [enabled by default] enum hrtimer_base_type { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:217:2: error: expected specifier-qualifier-list before ‘raw_spinlock_t’ raw_spinlock_t lock; ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:216:1: warning: empty declaration [enabled by default] struct hrtimer_cpu_base { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:242:63: error: expected declaration specifiers or ‘...’ before ‘ktime_t’ static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:248:69: error: expected declaration specifiers or ‘...’ before ‘ktime_t’ static inline void hrtimer_set_expires_range(struct hrtimer *timer, ktime_t time, ktime_t delta) ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:248:83: error: expected declaration specifiers or ‘...’ before ‘ktime_t’ static inline void hrtimer_set_expires_range(struct hrtimer *timer, ktime_t time, ktime_t delta) ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:254:72: error: expected declaration specifiers or ‘...’ before ‘ktime_t’ static inline void hrtimer_set_expires_range_ns(struct hrtimer *timer, ktime_t time, u64 delta) ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:261:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:266:63: error: expected declaration specifiers or ‘...’ before ‘ktime_t’ static inline void hrtimer_add_expires(struct hrtimer *timer, ktime_t time) ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:273:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:278:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘hrtimer_get_expires’ static inline ktime_t hrtimer_get_expires(const struct hrtimer *timer) ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:283:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘hrtimer_get_softexpires’ static inline ktime_t hrtimer_get_softexpires(const struct hrtimer *timer) ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:289:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:293:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:298:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:302:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘hrtimer_expires_remaining’ static inline ktime_t hrtimer_expires_remaining(const struct hrtimer *timer) ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:307:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘hrtimer_cb_get_time’ static inline ktime_t hrtimer_cb_get_time(struct hrtimer *timer) ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:313:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:331:48: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token static inline void clock_was_set_delayed(void) { } ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:336:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__hrtimer_expires_remaining_adjusted’ __hrtimer_expires_remaining_adjusted(const struct hrtimer *timer, ktime_t now) ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:350:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘hrtimer_expires_remaining_adjusted’ hrtimer_expires_remaining_adjusted(const struct hrtimer *timer) ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:356:13: error: storage class specified for parameter ‘clock_was_set’ extern void clock_was_set(void); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:360:48: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token static inline void timerfd_clock_was_set(void) { } ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:362:13: error: storage class specified for parameter ‘hrtimers_resume’ extern void hrtimers_resume(void); ^ In file included from /home/ubt/tina-d1-h/lichee/linux-5.4/include/asm-generic/percpu.h:7:0, from /home/ubt/tina-d1-h/lichee/linux-5.4//arch/riscv/include/generated/asm/percpu.h:1, from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu.h:13, from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:19, from pulse.c:16: /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:364:37: error: storage class specified for parameter ‘tick_cpu_device’ DECLARE_PER_CPU(struct tick_device, tick_cpu_device); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu-defs.h:101:44: note: in definition of macro ‘DECLARE_PER_CPU_SECTION’ extern __PCPU_ATTRS(sec) __typeof__(type) name ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:364:1: note: in expansion of macro ‘DECLARE_PER_CPU’ DECLARE_PER_CPU(struct tick_device, tick_cpu_device); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:364:37: error: section attribute not allowed for ‘tick_cpu_device’ DECLARE_PER_CPU(struct tick_device, tick_cpu_device); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/percpu-defs.h:101:44: note: in definition of macro ‘DECLARE_PER_CPU_SECTION’ extern __PCPU_ATTRS(sec) __typeof__(type) name ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:364:1: note: in expansion of macro ‘DECLARE_PER_CPU’ DECLARE_PER_CPU(struct tick_device, tick_cpu_device); ^ In file included from pulse.c:16:0: /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:370:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:378:13: error: storage class specified for parameter ‘hrtimer_init’ extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock, ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:380:13: error: storage class specified for parameter ‘hrtimer_init_sleeper’ extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, clockid_t clock_id, ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:395:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:402:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:406:68: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token static inline void destroy_hrtimer_on_stack(struct hrtimer *timer) { } ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:410:59: error: expected declaration specifiers or ‘...’ before ‘ktime_t’ extern void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:421:57: error: expected declaration specifiers or ‘...’ before ‘ktime_t’ static inline void hrtimer_start(struct hrtimer *timer, ktime_t tim, ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:427:12: error: storage class specified for parameter ‘hrtimer_cancel’ extern int hrtimer_cancel(struct hrtimer *timer); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:428:12: error: storage class specified for parameter ‘hrtimer_try_to_cancel’ extern int hrtimer_try_to_cancel(struct hrtimer *timer); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:432:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:445:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:450:16: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__hrtimer_get_remaining’ extern ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:452:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘hrtimer_get_remaining’ static inline ktime_t hrtimer_get_remaining(const struct hrtimer *timer) ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:457:12: error: storage class specified for parameter ‘hrtimer_get_next_event’ extern u64 hrtimer_get_next_event(void); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:458:12: error: storage class specified for parameter ‘hrtimer_next_event_without’ extern u64 hrtimer_next_event_without(const struct hrtimer *exclude); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:460:13: error: storage class specified for parameter ‘hrtimer_active’ extern bool hrtimer_active(const struct hrtimer *timer); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:471:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:481:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token { ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:487:40: error: expected declaration specifiers or ‘...’ before ‘ktime_t’ hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:487:53: error: expected declaration specifiers or ‘...’ before ‘ktime_t’ hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:506:11: error: expected declaration specifiers or ‘...’ before ‘ktime_t’ ktime_t interval) ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:513:12: error: storage class specified for parameter ‘nanosleep_copyout’ extern int nanosleep_copyout(struct restart_block *, struct timespec64 *); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:514:13: error: storage class specified for parameter ‘hrtimer_nanosleep’ extern long hrtimer_nanosleep(const struct timespec64 *rqtp, ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:518:37: error: expected declaration specifiers or ‘...’ before ‘ktime_t’ extern int schedule_hrtimeout_range(ktime_t *expires, u64 delta, ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:520:43: error: expected declaration specifiers or ‘...’ before ‘ktime_t’ extern int schedule_hrtimeout_range_clock(ktime_t *expires, ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:524:31: error: expected declaration specifiers or ‘...’ before ‘ktime_t’ extern int schedule_hrtimeout(ktime_t *expires, const enum hrtimer_mode mode); ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:527:13: error: storage class specified for parameter ‘hrtimer_run_queues’ extern void hrtimer_run_queues(void); ^ In file included from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/printk.h:6:0, from /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/kernel.h:15, from pulse.c:14: /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/init.h:50:27: error: expected declaration specifiers or ‘...’ before ‘.’ token #define __init __section(.init.text) __cold __latent_entropy __noinitretpoline __nocfi ^ /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:530:13: note: in expansion of macro ‘__init’ extern void __init hrtimers_init(void); ^ In file included from pulse.c:16:0: /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/hrtimer.h:533:13: error: storage class specified for parameter ‘sysrq_timer_list_show’ extern void sysrq_timer_list_show(void); ^ pulse.c:19:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token { ^ In file included from pulse.c:14:0: /home/ubt/tina-d1-h/lichee/linux-5.4/include/linux/kernel.h:328:6: error: old-style parameter declarations in prototyped function definition void do_exit(long error_code) __noreturn; ^ pulse.c:22:1: error: expected ‘{’ at end of input } ^ make: *** [pulse.o] Error 1 [2]+ Done $T/tools/build/buildserver --path $T 2> /dev/null 1>&2
可以确定肯定不是这么搞的,我还是再去学习下怎么添加驱动程序看看
-
才发现之前翻了半天论坛和手册才搞明白的SDK基础操作V853的这个网页讲的很清楚,D1H的网页里都没写
-
@allwinner_account 在 【萌新】D1H如何使用硬件定时器? 中说:
才发现之前翻了半天论坛和手册才搞明白的SDK基础操作V853的这个网页讲的很清楚,D1H的网页里都没写
比如哪些?我复制过去
-
@xiaowenge
系统配置/应用打包这两个 -
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号