X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=simavr%2Fsim%2Favr_twi.h;h=e21e3b6bd7b47addaa556f3a16927b7b372b1974;hb=242d9d81f037c7114282ae0da520200b288b8369;hp=21c3687e7d9c47b92e9913a50aaf93d443561cff;hpb=f5cb51ee9eec403ec656899f02ee2a09fd4b9378;p=simavr diff --git a/simavr/sim/avr_twi.h b/simavr/sim/avr_twi.h index 21c3687..e21e3b6 100644 --- a/simavr/sim/avr_twi.h +++ b/simavr/sim/avr_twi.h @@ -22,6 +22,10 @@ #ifndef AVR_TWI_H_ #define AVR_TWI_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include "sim_avr.h" //#include "sim_twi.h" @@ -94,21 +98,17 @@ avr_twi_init( avr_twi_t * port); /* - * Create a message value for twi incuding the 'msg' bitfield, + * Create a message value for twi including the 'msg' bitfield, * 'addr' and data. This value is what is sent as the IRQ value */ -static inline uint32_t +uint32_t avr_twi_irq_msg( uint8_t msg, uint8_t addr, - uint8_t data) -{ - avr_twi_msg_irq_t _msg = { - .u.twi.msg = msg, - .u.twi.addr = addr, - .u.twi.data = data, - }; - return _msg.u.v; -} + uint8_t data); + +#ifdef __cplusplus +}; +#endif #endif /* AVR_TWI_H_ */