// SPDX-License-Identifier: Apache-2.0 // Copyright (c) 2012-2024 Scott Penrose and WII5 Buoy contributors // // This file is part of WII5 Buoy firmware. // See LICENSE for full terms. #define BitVal(data,y) ( (data>>y) & 1) /** Return Data.Y value **/ #define SetBit(data,y) data |= (1 << y) /** Set Data.Y to 1 **/ #define ClearBit(data,y) data &= ~(1 << y) /** Clear Data.Y to 0 **/ #include #include int main() { uint32_t out = 0; // Main header - where am I, what is my voltss SetBit(out, 1); // Standard WII output SetBit(out, 11); SetBit(out, 12); SetBit(out, 13); SetBit(out, 14); printf("New Number = %d\n", out); return(0); }