1 |
//-------------------------------------------------------------------------------
|
2 |
//$Header: /home/dashley/cvsrep/uculib01/uculib01/src/stm8/cosmic/modxx/btu16bitcardrxx/src/btu16bitcardrxx.c,v 1.4 2010/02/11 18:29:47 dashley Exp $
|
3 |
//-------------------------------------------------------------------------------
|
4 |
//Copyright (c)2010 David T. Ashley
|
5 |
//
|
6 |
//Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 |
//of this software source code and associated documentation files (the
|
8 |
//"Software"), to deal in the Software without restriction, including without
|
9 |
//limitation the rights to use, copy, modify, merge, publish, distribute,
|
10 |
//sublicense, and/or sell copies of the Software, and to permit persons to whom
|
11 |
//the Software is furnished to do so, subject to the following conditions:
|
12 |
//
|
13 |
//The above copyright notice and this permission notice shall be included in
|
14 |
//all copies or substantial portions of the Software.
|
15 |
//
|
16 |
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17 |
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18 |
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19 |
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20 |
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21 |
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22 |
//THE SOFTWARE.
|
23 |
//-------------------------------------------------------------------------------
|
24 |
|
25 |
#include "uculib.h"
|
26 |
|
27 |
|
28 |
UCU_UINT8 UcuBtU16BitCardRxx( UCU_UINT16 arg )
|
29 |
{
|
30 |
UCU_UNION16 temp;
|
31 |
|
32 |
temp.ui = arg; //Assign so we can pick it apart.
|
33 |
|
34 |
//The value to return is the sum of the cardinalities of the bytes.
|
35 |
return(UcuBtU8BitCardRxx(temp.uc[0]) + UcuBtU8BitCardRxx(temp.uc[1]));
|
36 |
}
|
37 |
|
38 |
|
39 |
//-------------------------------------------------------------------------------
|
40 |
//End of $Id: btu16bitcardrxx.c,v 1.4 2010/02/11 18:29:47 dashley Exp $
|
41 |
//-------------------------------------------------------------------------------
|
42 |
//$Log: btu16bitcardrxx.c,v $
|
43 |
//Revision 1.4 2010/02/11 18:29:47 dashley
|
44 |
//Documentation removed.
|
45 |
//
|
46 |
//Revision 1.3 2010/01/31 02:46:48 dashley
|
47 |
//Bit cardinality functions added.
|
48 |
//
|
49 |
//Revision 1.2 2010/01/22 04:12:11 dashley
|
50 |
//Extra line removed.
|
51 |
//
|
52 |
//Revision 1.1 2010/01/22 04:11:33 dashley
|
53 |
//Initial checkin.
|
54 |
//-------------------------------------------------------------------------------
|
55 |
|