可变参数函数又称参数个数可变函数(本文也简称变参函数),即函数参数数目可变。 函数示例 1. #define dcs_write_seq(dev, seq...) \ ({ \ static
const u8 d[] = { seq }; \ otm8009a_dcs_write_buf(dev,
d, ARRAY_SIZE(d)); \ }) 2. #define dcs_write_cmd_at(dev,
cmd, seq...) \ ({ \ static
const u16 c = cmd; \ struct
udevice *device = dev; \ dcs_write_seq(device,
MCS_ADRSFT, c); \ dcs_write_seq(device,
c, seq); \
}) dcs_write_cmd_at(dev,MCS_PANSET,0xFF,0x83,0x94
); seq... 传入了所有参数,但是定义时只用了aeq... |
|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )
GMT+8, 2024-11-24 21:47
Powered by Discuz! X3.4
© 2001-2013 Comsenz Inc.