From fa1dc85d0a8ca03e24a8c48d7916f272c3f138e6 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Tue, 3 Apr 2012 00:49:55 +0200 Subject: digital/avr/modules/proto: add automatic send[bwd] with n arguments --- digital/avr/modules/proto/proto_inline.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'digital/avr/modules/proto/proto_inline.c') diff --git a/digital/avr/modules/proto/proto_inline.c b/digital/avr/modules/proto/proto_inline.c index 43110c8e..58779ec8 100644 --- a/digital/avr/modules/proto/proto_inline.c +++ b/digital/avr/modules/proto/proto_inline.c @@ -23,6 +23,17 @@ * * }}} */ #include "modules/utils/byte.h" +#include "preproc.h" + +/** Send a command with n byte arguments. */ +#define proto_sendb(cmd, args...) \ + PREPROC_PASTE (proto_send, PREPROC_NARG (args), b) (cmd, args) +/** Send a command with n word arguments. */ +#define proto_sendw(cmd, args...) \ + PREPROC_PASTE (proto_send, PREPROC_NARG (args), w) (cmd, args) +/** Send a command with n double word arguments. */ +#define proto_sendd(cmd, args...) \ + PREPROC_PASTE (proto_send, PREPROC_NARG (args), d) (cmd, args) /** Send a command with no argument. */ extern inline void -- cgit v1.2.3