2 /* -------------------------------- Arctic Core ------------------------------
\r
3 * Arctic Core - the open source AUTOSAR platform http://arccore.com
\r
5 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
\r
7 * This source code is free software; you can redistribute it and/or modify it
\r
8 * under the terms of the GNU General Public License version 2 as published by the
\r
9 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
\r
11 * This program is distributed in the hope that it will be useful, but
\r
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
\r
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
\r
15 * -------------------------------- Arctic Core ------------------------------*/
\r
18 * Bit manipulation functions, NOT tested..
\r
26 * @param aPtr Ptr to an array of unsigned chars.
\r
27 * @param num The bit number to get.
\r
30 static inline int Bit_Get(uint8_t *aPtr, int num ) {
\r
31 return (aPtr[num / 8] >> (num % 8)) & 1;
\r
40 static inline void Bit_Set(uint8_t *aPtr, int num ) {
\r
41 aPtr[num / 8] |= (1<<(num % 8));
\r
50 static inline void Bit_Clear(uint8_t *aPtr, int num ) {
\r
51 aPtr[num / 8] &= ~(1<<(num % 8));
\r