summaryrefslogtreecommitdiff
path: root/apps/plugins/alpine_cdc.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/alpine_cdc.c')
-rw-r--r--apps/plugins/alpine_cdc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/plugins/alpine_cdc.c b/apps/plugins/alpine_cdc.c
index a7aeec306f..494fa17842 100644
--- a/apps/plugins/alpine_cdc.c
+++ b/apps/plugins/alpine_cdc.c
@@ -669,16 +669,16 @@ void dump_packet(char* dest, int dst_size, char* src, int n)
669 669
670bool bit_test(unsigned char* buf, unsigned bit) 670bool bit_test(unsigned char* buf, unsigned bit)
671{ 671{
672 return (buf[bit/4] & (0x01 << bit%4)) != 0; 672 return (buf[bit>>2] & BIT_N(bit&3)) != 0;
673} 673}
674 674
675 675
676void bit_set(unsigned char* buf, unsigned bit, bool val) 676void bit_set(unsigned char* buf, unsigned bit, bool val)
677{ 677{
678 if (val) 678 if (val)
679 buf[bit/4] |= (0x01 << bit%4); 679 buf[bit>>2] |= BIT_N(bit&3);
680 else 680 else
681 buf[bit/4] &= ~(0x01 << bit%4); 681 buf[bit>>2] &= ~BIT_N(bit&3);
682} 682}
683 683
684 684