Commit 94818bde authored by Your Name's avatar Your Name
Browse files

update Cmake and blc without blibs

parent 7aeb0054
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.13)
project(bapps)
......
......@@ -4,13 +4,13 @@ cmake_minimum_required(VERSION 2.6)
# Set the name of the project as the directory basename
project(f_max)
find_package(blc_channel)
find_package(blc_program)
find_package(blc)
add_definitions(${BL_DEFINITIONS})
include_directories(${BL_INCLUDE_DIRS})
add_executable(f_max f_max.cpp)
target_link_libraries(f_max ${BL_LIBRARIES})
target_compile_options(f_max PRIVATE -Wno-multichar)
target_compile_features(f_max PRIVATE cxx_std_14)
target_link_libraries(f_max PRIVATE blc rt)
......
......@@ -2,8 +2,8 @@
// Created by Arnaud Blanchard on 22/12/15.
// Copyright ETIS 2015. All rights reserved.
//
#include "blc_channel.h"
#include "blc_program.h"
#include "blc.h"
#include <unistd.h>
#include <math.h>
......@@ -78,7 +78,7 @@ int main(int argc, char **argv){
}
else
{
output.create_or_open(output_name, BLC_CHANNEL_WRITE, input.type, 'NDEF', 1, 1);
output.create_or_open(output_name, BLC_CHANNEL_WRITE, input.type, 'NDEF', {1});
output.publish();
blc_loop_try_add_waiting_semaphore(output.sem_ack_data);
......
......@@ -3,23 +3,21 @@
# This software is governed by the CeCILL v2.1 license under French law and abiding by the rules of distribution of free software.
# You can use, modify and/ or redistribute the software under the terms of the CeCILL v2.1 license as circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
# As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
# users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability.
# In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software,
# that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge.
# Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured  and, more generally, to use and operate it in the same conditions as regards security.
# The fact that you are presently reading this means that you have had knowledge of the CeCILL v2.1 license and that you accept its terms.
# users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability.
# In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software,
# that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge.
# Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured and, more generally, to use and operate it in the same conditions as regards security.
# The fact that you are presently reading this means that you have had knowledge of the CeCILL v2.1 license and that you accept its terms.
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.13)
project(i_discretize_file)
find_package(blc_channel REQUIRED)
find_package(blc_program REQUIRED)
find_package(blc REQUIRED)
add_definitions(${BL_DEFINTIIONS})
include_directories(${BL_INCLUDE_DIRS})
add_executable(i_discretize_file i_discretize_file.cpp)
target_link_libraries(i_discretize_file ${BL_LIBRARIES})
target_compile_features(i_discretize_file PRIVATE cxx_std_17)
target_link_libraries(i_discretize_file PRIVATE blc rt)
......
//Read only array of dim 1
#include "blc_core.h"
#include "blc_channel.h"
#include "blc_program.h"
#include "blc.h"
#include <unistd.h>
#include <termios.h>
#include <libgen.h> //basename
......@@ -58,7 +57,7 @@ int main(int argc, char** argv){
SSCANF(1, offset_str, "%f", &offset);
SSCANF(1, gain_str, "%f", &gain);
channel.create_or_open(channel_name, BLC_CHANNEL_WRITE, 'FL32', 'LPCM', 1, length);
channel.create_or_open(channel_name, BLC_CHANNEL_WRITE, 'FL32', 'LPCM', {length});
blc_loop_try_add_posting_semaphore(channel.sem_new_data);
blc_loop_try_add_waiting_semaphore(channel.sem_ack_data);
......
......@@ -3,25 +3,22 @@
# This software is governed by the CeCILL v2.1 license under French law and abiding by the rules of distribution of free software.
# You can use, modify and/ or redistribute the software under the terms of the CeCILL v2.1 license as circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
# As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
# users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability.
# In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software,
# that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge.
# Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured  and, more generally, to use and operate it in the same conditions as regards security.
# The fact that you are presently reading this means that you have had knowledge of the CeCILL v2.1 license and that you accept its terms.
# users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability.
# In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software,
# that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge.
# Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured and, more generally, to use and operate it in the same conditions as regards security.
# The fact that you are presently reading this means that you have had knowledge of the CeCILL v2.1 license and that you accept its terms.
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.13)
#The name of the project is the basename of the directory
get_filename_component(PROJECT_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)
project(${PROJECT_NAME})
find_package(blc_channel REQUIRED)
find_package(blc_program REQUIRED)
find_package(blc REQUIRED)
add_definitions(${BL_DEFINTIIONS})
include_directories(${BL_INCLUDE_DIRS})
add_executable(${PROJECT_NAME} i_fread.cpp)
target_link_libraries(${PROJECT_NAME} ${BL_LIBRARIES})
target_link_libraries(${PROJECT_NAME} PRIVATE blc rt)
......
//Read only array of dim 1
#include "blc.h"
#include "blc_core.h"
#include "blc_channel.h"
#include "blc_program.h"
#include <unistd.h>
#include <termios.h>
#include <libgen.h> //basename
......@@ -46,7 +44,7 @@ static void array_def_with_tsv_file_first_line(blc_array *array, char const *fil
if (time_str) length--; //The first coulmn dos not count it is the time.
array->def_array('FL32', 'NDEF', 1, length);
array->def_array('FL32', 'NDEF', {length});
fclose(file);
}
......
......@@ -3,23 +3,21 @@
# This software is governed by the CeCILL v2.1 license under French law and abiding by the rules of distribution of free software.
# You can use, modify and/ or redistribute the software under the terms of the CeCILL v2.1 license as circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
# As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
# users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability.
# In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software,
# that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge.
# Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured  and, more generally, to use and operate it in the same conditions as regards security.
# The fact that you are presently reading this means that you have had knowledge of the CeCILL v2.1 license and that you accept its terms.
# users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability.
# In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software,
# that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge.
# Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured and, more generally, to use and operate it in the same conditions as regards security.
# The fact that you are presently reading this means that you have had knowledge of the CeCILL v2.1 license and that you accept its terms.
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.13)
project(i_keyboard)
find_package(blc_channel REQUIRED)
find_package(blc_program REQUIRED)
find_package(blc REQUIRED)
add_definitions(${BL_DEFINITIONS} -std=c++14 -W -Wall)
include_directories(${BL_INCLUDE_DIRS})
add_executable(i_keyboard src/i_keyboard.cpp)
target_link_libraries(i_keyboard ${BL_LIBRARIES})
target_compile_features(i_keyboard PRIVATE cxx_std_14)
target_link_libraries(i_keyboard PRIVATE blc rt)
......
#include "blc_core.h"
#include "blc_channel.h"
#include "blc_program.h"
#include "blc.h"
#include <unistd.h>
#include <termios.h>
#include <libgen.h> //basename
......@@ -13,7 +12,7 @@ static blc_mem table;
static char *key_list;
static char const *display;
static int keys_nb;
static uchar min, max;
static uchar vmin, vmax;
static uchar quitting_key=0, neutral_key;
static float neutral_value, max_value, min_value, float_step_size=0.004;
static uchar uchar_step_size=1;
......@@ -26,7 +25,7 @@ static int update_index(int *index){
SYSTEM_ERROR_CHECK(ret=read(STDIN_FILENO, answer, 3), -1, "Waiting for keyboard input");
if (ret==1)
{
if (answer[0] >= min && answer[0] <= max && ((index_tmp=table.uchars[*answer-min]) != keys_nb)){
if (answer[0] >= vmin && answer[0] <= vmax && ((index_tmp=table.uchars[*answer-vmin]) != keys_nb)){
*index=index_tmp;
return INDEX_KEY;
}
......@@ -304,7 +303,7 @@ int main(int argc, char** argv){
if (memchr(key_list, quitting_key, keys_nb)) EXIT_ON_ERROR("The quitting key '%c' is in your key list %.*s, you need to select an other one with --quitting_key=...", quitting_key, keys_nb, key_list);
if (memchr(key_list, neutral_key, keys_nb)) EXIT_ON_ERROR("The neutral key '%c' is in your key list %.*s, you need to select an other one with --neutral_key=...", neutral_key, keys_nb, key_list);
created=channel.create_or_open(channel_name, BLC_CHANNEL_WRITE, type, 'NDEF', 1, keys_nb);
created=channel.create_or_open(channel_name, BLC_CHANNEL_WRITE, type, 'NDEF', {keys_nb});
if (filename){
extension = blc_get_filename_extension(filename);
......@@ -337,16 +336,16 @@ int main(int argc, char** argv){
fprintf(stderr, "Waiting for one key in '%.*s'. Quitting with '%s'\n", keys_nb, key_list, str_quitting_key);
//We pre calculate the answers
max=min=key_list[0];
vmax=vmin=key_list[0];
FOR(i, keys_nb) {
answer=key_list[i];
if (answer<min) min =answer;
else if (answer>max) max=answer;
if (answer<vmin) vmin =answer;
else if (answer>vmax) vmax=answer;
}
table.allocate(max-min+1);
table.allocate(vmax-vmin+1);
FOR(i, (int)table.size){
pos=strchr(key_list, i+min);
pos=strchr(key_list, i+vmin);
if (pos) table.uchars[i]=pos-key_list;
else table.uchars[i]=keys_nb;
}
......
# Set the minimum version of cmake required to build this project
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.13)
# Set the name of the project as the directory basename
project(i_oscillator)
find_package(blc_channel)
find_package(blc_program)
find_package(blc)
add_definitions(${BL_DEFINITIONS})
include_directories(${BL_INCLUDE_DIRS})
add_executable(i_oscillator i_oscillator.cpp)
target_link_libraries(i_oscillator ${BL_LIBRARIES})
target_compile_features(i_oscillator PRIVATE cxx_std_14)
target_link_libraries(i_oscillator PRIVATE blc rt)
......
......@@ -2,9 +2,7 @@
// Created by Arnaud Blanchard on 22/12/15.
// Copyright ETIS 2015. All rights reserved.
//
#include "blc_core.h"
#include "blc_channel.h"
#include "blc_program.h"
#include "blc.h"
#include <unistd.h>
#include <math.h>
......@@ -54,7 +52,7 @@ int main(int argc, char **argv){
uint32_t type;
blc_program_add_option(&channel_name, 'o', "output", "blc_channel-in", "channel name", DEFAULT_OUTPUT_NAME);
blc_program_add_option(&display, 'd', "display", NULL, "display value at each iteration", NULL);
blc_program_add_option(&display, 'd', "display", nullptr, "display value at each iteration", nullptr);
blc_program_add_option(&buffer_length_str, 's', "size", "integer", "buffer size (items nb)", "1");
blc_program_add_option(&frequency_str, 'f', "frequency", "float", "frequency in Hz", "1");
blc_program_add_option(&min_str, 'm', "min", "float", "minimum value of oscillation", "0");
......@@ -75,7 +73,7 @@ int main(int argc, char **argv){
SSCANF(1, min_str, "%f", &min);
SSCANF(1, max_str, "%f", &max);
output.create_or_open(channel_name, BLC_CHANNEL_WRITE, type, 'NDEF', 1, buffer_length);
output.create_or_open(channel_name, BLC_CHANNEL_WRITE, type, 'NDEF', {buffer_length});
output.publish();
/*
......
......@@ -4,13 +4,10 @@ cmake_minimum_required(VERSION 2.6)
# Set the name of the project as the directory basename
project(o_display)
find_package(blc_channel)
find_package(blc_program)
find_package(blc)
add_definitions(${BL_DEFINITIONS} -std=c++11)
include_directories(${BL_INCLUDE_DIRS})
add_executable(o_display o_display.cpp)
target_link_libraries(o_display ${BL_LIBRARIES})
target_link_libraries(o_display PRIVATE blc rt)
......
......@@ -2,13 +2,10 @@
// Created by Arnaud Blanchard on 22/12/15.
// Copyright ETIS 2015. All rights reserved.
//
#include "blc_core.h"
#include "blc_channel.h"
#include "blc_program.h"
#include "blc.h"
#include <unistd.h>
#include <math.h>
int columns_nb=64;
int rows_nb=16;
......
......@@ -3,25 +3,22 @@
# This software is governed by the CeCILL v2.1 license under French law and abiding by the rules of distribution of free software.
# You can use, modify and/ or redistribute the software under the terms of the CeCILL v2.1 license as circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
# As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license,
# users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability.
# In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software,
# that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge.
# Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured  and, more generally, to use and operate it in the same conditions as regards security.
# The fact that you are presently reading this means that you have had knowledge of the CeCILL v2.1 license and that you accept its terms.
# users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability.
# In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software,
# that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge.
# Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured and, more generally, to use and operate it in the same conditions as regards security.
# The fact that you are presently reading this means that you have had knowledge of the CeCILL v2.1 license and that you accept its terms.
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.13)
#The name of the project is the basename of the directory
get_filename_component(PROJECT_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)
project(${PROJECT_NAME})
find_package(blc_channel REQUIRED)
find_package(blc_program REQUIRED)
find_package(blc REQUIRED)
add_definitions(${BL_DEFINTIIONS})
include_directories(${BL_INCLUDE_DIRS})
add_executable(${PROJECT_NAME} o_fwrite.cpp)
target_link_libraries(${PROJECT_NAME} ${BL_LIBRARIES})
target_link_libraries(${PROJECT_NAME} PRIVATE blc rt )
......
#include "blc_core.h"
#include "blc_channel.h"
#include "blc_program.h"
#include "blc.h"
#include <unistd.h>
#include <termios.h>
#include <libgen.h> //basename
......
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