Commit 79224bc7 by developer2

ufr_rf_analog

parent 2f03b148
......@@ -177,8 +177,8 @@
<option id="gnu.cpp.compiler.mingw.exe.release.option.debugging.level.465219783" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.release.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
</tool>
<tool errorParsers="org.eclipse.cdt.core.GCCErrorParser" id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.726089316" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release">
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.mingw.exe.release.option.optimization.level.1439164278" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.release.option.optimization.level" useByScannerDiscovery="false" value="gnu.c.optimization.level.none" valueType="enumerated"/>
<option id="gnu.c.compiler.mingw.exe.release.option.debugging.level.1246027943" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.release.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.mingw.exe.release.option.optimization.level.1439164278" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.release.option.optimization.level" useByScannerDiscovery="false" value="gnu.c.optimization.level.most" valueType="enumerated"/>
<option id="gnu.c.compiler.mingw.exe.release.option.debugging.level.1246027943" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.release.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.none" valueType="enumerated"/>
<option id="gnu.c.compiler.option.dialect.std.177372731" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.c.compiler.dialect.c99" valueType="enumerated"/>
<option id="gnu.c.compiler.option.include.paths.2086448260" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="../lib/include"/>
......@@ -233,8 +233,8 @@
<option id="gnu.cpp.compiler.mingw.exe.release.option.debugging.level.18964394" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.release.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
</tool>
<tool errorParsers="org.eclipse.cdt.core.GCCErrorParser" id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.1618523732" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release">
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.mingw.exe.release.option.optimization.level.1714954709" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.release.option.optimization.level" useByScannerDiscovery="false" value="gnu.c.optimization.level.none" valueType="enumerated"/>
<option id="gnu.c.compiler.mingw.exe.release.option.debugging.level.1138701170" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.release.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.mingw.exe.release.option.optimization.level.1714954709" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.release.option.optimization.level" useByScannerDiscovery="false" value="gnu.c.optimization.level.most" valueType="enumerated"/>
<option id="gnu.c.compiler.mingw.exe.release.option.debugging.level.1138701170" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.release.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.none" valueType="enumerated"/>
<option id="gnu.c.compiler.option.dialect.std.741058868" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.c.compiler.dialect.c99" valueType="enumerated"/>
<option id="gnu.c.compiler.option.include.paths.140478248" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="../lib/include"/>
......@@ -267,7 +267,7 @@
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.1996904953.1616111618" moduleId="org.eclipse.cdt.core.settings" name="linux64_release">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
......@@ -322,7 +322,7 @@
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.1996904953.1616111618.829690159" moduleId="org.eclipse.cdt.core.settings" name="linux64_debug">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
......@@ -379,7 +379,7 @@
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.1996904953.1616111618.339612080" moduleId="org.eclipse.cdt.core.settings" name="linux32_release">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
......@@ -434,7 +434,7 @@
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.1996904953.1616111618.829690159.2143475306" moduleId="org.eclipse.cdt.core.settings" name="linux32_debug">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>template-console</name>
<name>ufr_rf_analog</name>
<comment></comment>
<projects>
</projects>
......
......@@ -5,11 +5,14 @@
#
$(VERBOSE).SILENT:
PRJNAME = ufr_rf_analog
all : help
help info :
echo "----------------------------------------------"
echo "Making example to test Reader opening function"
echo "Project output name: $(PRJNAME)"
echo "----------------------------------------------"
echo "For 32 bit Windows - type: 'make win32'"
echo "For 64 bit Windows - type: 'make win64'"
......@@ -18,23 +21,23 @@ help info :
echo "----------------------------------------------"
lin32 linux32 :
cd linux32_release && gcc -m32 -o template-console ../src/*.c -I../lib/include -L../lib/linux/x86 -luFCoder-x86 -Wl,-R../lib/linux/x86
cd linux32_release && gcc -m32 -o $(PRJNAME) ../src/*.c -I../lib/include -L../lib/linux/x86 -luFCoder-x86 -Wl,-R../lib/linux/x86
echo "Making done, without errors."
echo "To run the example - type:"
echo " 'cd linux32_release && ./template-console'"
echo " 'cd linux32_release && ./$(PRJNAME)'"
lin64 linux64 :
cd linux64_release && gcc -m64 -o template-console ../src/*.c -I../lib/include -L../lib/linux/x86_64 -luFCoder-x86_64 -Wl,-R../lib/linux/x86_64
cd linux64_release && gcc -m64 -o $(PRJNAME) ../src/*.c -I../lib/include -L../lib/linux/x86_64 -luFCoder-x86_64 -Wl,-R../lib/linux/x86_64
echo "Making done, without errors."
echo "To run the example - type:"
echo " 'cd linux64_release && ./template-console'"
echo " 'cd linux64_release && ./$(PRJNAME)'"
win32 :
echo "If You see error like: 'skipping incompatible lib/windows/x86/uFCoder-x86.dll when searching for...'"
echo " This means You have the gcc compiler for 64 bit"
echo " type 'make win64' instead of 'make win32'"
echo ""
cd win32_release && gcc -o template-console ../src/*.c -I../lib/include -L../lib/windows/x86 -luFCoder-x86 -Wl,-Rlib/windows/x86 -Wl,--enable-stdcall-fixup
cd win32_release && gcc -o $(PRJNAME) ../src/*.c -I../lib/include -L../lib/windows/x86 -luFCoder-x86 -Wl,-Rlib/windows/x86 -Wl,--enable-stdcall-fixup
echo "Making done, without errors."
echo "To run the example - type:"
echo " 'cd win32_release'"
......@@ -45,7 +48,7 @@ win64 :
echo " This means You have the gcc compiler for 32 bit"
echo " type 'make win32' instead of 'make win64'"
echo ""
cd win64_release && gcc -o template-console ../src/*.c -I../lib/include -L../lib/windows/x86_64 -luFCoder-x86_64 -Wl,-Rlib/windows/x86_64
cd win64_release && gcc -o $(PRJNAME) ../src/*.c -I../lib/include -L../lib/windows/x86_64 -luFCoder-x86_64 -Wl,-Rlib/windows/x86_64
echo "Making done, without errors."
echo "You must use library from the 'lib\windows\x86_64\'"
echo ""
......
lib @ e26eef76
Subproject commit 70617467346c37a45fd0514a02de78a002ba8066
Subproject commit e26eef7640a6283ab9369074fc1652e68640dcdb
......@@ -5,21 +5,21 @@
#ifndef INI_H_
#define INI_H_
#define APP_VERSION "0.0"
#define APP_VERSION "1.0"
#define EXIT_ON_WRONG_FW_DEPENDENCY
#define MIN_DEPEND_FW_VER_MAJOR 0
#define MIN_DEPEND_FW_VER_MINOR 0
#define MIN_DEPEND_FW_VER_BUILD 0
#define MIN_DEPEND_FW_VER_MAJOR 3
#define MIN_DEPEND_FW_VER_MINOR 9
#define MIN_DEPEND_FW_VER_BUILD 54
#define EXIT_ON_WRONG_LIB_DEPENDENCY
#define MIN_DEPEND_LIB_VER_MAJOR 0
#define MIN_DEPEND_LIB_VER_MINOR 0
#define MIN_DEPEND_LIB_VER_BUILD 0
#define MIN_DEPEND_LIB_VER_MAJOR 4
#define MIN_DEPEND_LIB_VER_MINOR 3
#define MIN_DEPEND_LIB_VER_BUILD 3
#ifdef __DEBUG
# if __WIN32 || __WIN64
# define PORT_NAME "COM3"
# define PORT_NAME "COM5"
# else
# define PORT_NAME "/dev/ttyS3"
# endif
......
......@@ -70,16 +70,24 @@ int main(void)
getchar();
return EXIT_FAILURE;
}
if (!CheckDependencies())
status = ReaderReset();
if (status != UFR_OK)
{
ReaderClose();
printf("Error while opening device, status is: 0x%08X\n", status);
getchar();
return EXIT_FAILURE;
}
status = ReaderReset();
if (status != UFR_OK)
#if __WIN32 || __WIN64
Sleep(500);
#else // if linux || __linux__ || __APPLE__
usleep(500000);
#endif
if (!CheckDependencies())
{
printf("Error while opening device, status is: 0x%08X\n", status);
ReaderClose();
getchar();
return EXIT_FAILURE;
}
......@@ -165,10 +173,6 @@ void menu(char key)
Operation2();
break;
case '3':
Operation3();
break;
case '\x1b':
break;
......@@ -181,14 +185,13 @@ void menu(char key)
void usage(void)
{
printf(" +------------------------------------------------+\n"
" | Application title |\n"
" | uFR RF analog registers setting |\n"
" | version "APP_VERSION" |\n"
" +------------------------------------------------+\n"
" For exit, hit escape.\n");
printf(" --------------------------------------------------\n");
printf(" (1) - Option 1\n"
" (2) - Option 2\n"
" (3) - Option 3\n");
printf(" (1) - Set maximal RF receiver gain\n"
" (2) - Set default RF analog registers setting\n");
}
//------------------------------------------------------------------------------
UFR_STATUS NewCardInField(uint8_t sak, uint8_t *uid, uint8_t uid_size)
......@@ -210,15 +213,32 @@ UFR_STATUS NewCardInField(uint8_t sak, uint8_t *uid, uint8_t uid_size)
//------------------------------------------------------------------------------
void Operation1(void)
{
UFR_STATUS status;
printf(" -------------------------------------------------------------------\n");
printf(" Operation 1 \n");
printf(" Set maximal gain of RF receiver \n");
status = SetRfAnalogRegistersTypeA(8, 7, 0, 7, 9);
if(status == UFR_OK)
printf(" Operation is OK \n");
else
printf(" Operation failed \n");
printf(" -------------------------------------------------------------------\n");
}
//------------------------------------------------------------------------------
void Operation2(void)
{
UFR_STATUS status;
printf(" -------------------------------------------------------------------\n");
printf(" Operation 2 \n");
printf(" Set default RF analog registers setting \n");
status = SetRfAnalogRegistersTypeADefault();
if(status == UFR_OK)
printf(" Operation is OK \n");
else
printf(" Operation failed \n");
printf(" -------------------------------------------------------------------\n");
}
//------------------------------------------------------------------------------
......
......@@ -61,7 +61,7 @@ bool CheckDependencies(void) {
wrong_version = true;
} else if (version_major == MIN_DEPEND_FW_VER_MAJOR && version_minor < MIN_DEPEND_FW_VER_MINOR) {
wrong_version = true;
} else if (version_major == MIN_DEPEND_LIB_VER_MAJOR && version_minor == MIN_DEPEND_FW_VER_MINOR && build < MIN_DEPEND_FW_VER_BUILD) {
} else if (version_major == MIN_DEPEND_FW_VER_MAJOR && version_minor == MIN_DEPEND_FW_VER_MINOR && build < MIN_DEPEND_FW_VER_BUILD) {
wrong_version = true;
}
......
@echo off
set path=..\lib\windows\x86;%path%
template-console.exe
ufr_rf_analog.exe
@echo off
set path=..\lib\windows\x86_64;%path%
template-console.exe
ufr_rf_analog.exe
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment