[Hamlib-cvs-digest] CVS: hamlib/tests testbcd.c,1.2,1.3
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Stephane F. <f4...@us...> - 2000-10-16 22:10:40
|
Update of /cvsroot/hamlib/hamlib/tests In directory slayer.i.sourceforge.net:/tmp/cvs-serv28278 Modified Files: testbcd.c Log Message: Added Big Endian tests Index: testbcd.c =================================================================== RCS file: /cvsroot/hamlib/hamlib/tests/testbcd.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** testbcd.c 2000/10/08 21:43:00 1.2 --- testbcd.c 2000/10/16 22:10:37 1.3 *************** *** 17,21 **** if (argc != 2) { ! fprintf(stderr,"%s <freq>\n",argv[0]); exit(1); } --- 17,21 ---- if (argc != 2) { ! fprintf(stderr,"Usage: %s <freq>\n",argv[0]); exit(1); } *************** *** 23,30 **** --- 23,37 ---- f = atoi(argv[1]); + printf("Little Endian mode\n"); printf("Frequency: %lld\n",f); to_bcd(b, f, 10); printf("BCD: %2.2x,%2.2x,%2.2x,%2.2x,%2.2x\n",b[0],b[1],b[2],b[3],b[4]); printf("Result after recoding: %lld\n", from_bcd(b, 10)); + + printf("\nBig Endian mode\n"); + printf("Frequency: %lld\n",f); + to_bcd_be(b, f, 10); + printf("BCD: %2.2x,%2.2x,%2.2x,%2.2x,%2.2x\n",b[0],b[1],b[2],b[3],b[4]); + printf("Result after recoding: %lld\n", from_bcd_be(b, 10)); return 0; |