Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/user/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ Now build *microblx*:
$ make
$ sudo make install

note: it might be necessary to build with

.. code:: bash

$ make CXXFLAGS="-std=c++11"

to compile the cppdemo.cpp

Using yocto
-----------
Expand Down
20 changes: 14 additions & 6 deletions std_blocks/cppdemo/cppdemo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ char cppdemo_meta[] =
"}";

ubx_proto_config_t cppdemo_config[] = {
{ .name="test_conf", .type_name="double", .doc="a test config value" },
{ .name="test_conf",
.type_name="double",
.attrs=0,
.min=0,
.max=0,
.doc="a test config value"
},
{ 0 },
};

ubx_proto_port_t cppdemo_ports[] = {
{ .name="foo", .in_type_name="unsigned int", .doc="Out port writing foo unsigned ints" },
{ .name="bar", .out_type_name="unsigned int", .doc="In port reading bar unsigned ints" },
ubx_proto_port_t cppdemo_ports[] = {// filled in also unused fields to make compatible with g++
{ name:"foo",attrs:0, out_type_name:"", out_data_len:0, in_type_name:"unsigned int",in_data_len:0, doc:"Out port writing foo unsigned ints" },
{ name:"bar",attrs:0, out_type_name:"unsigned int", out_data_len:0,in_type_name:"",in_data_len:0, doc:"In port reading bar unsigned ints" },
{ 0 },
};

Expand Down Expand Up @@ -62,13 +68,15 @@ ubx_proto_block_t cppdemo_comp =
{
.name = "cppdemo",
.meta_data = cppdemo_meta,
.attrs = 0,
.type = BLOCK_TYPE_COMPUTATION,
.configs = cppdemo_config,
.ports = NULL, // fill in to make compatible with g++
.init = cppdemo_init,
.start = cppdemo_start,
.stop = cppdemo_stop,
.cleanup = cppdemo_cleanup,
.step = cppdemo_step,
.cleanup = cppdemo_cleanup,{
.step = cppdemo_step,}
};

static int cppdemo_init(ubx_node_t* nd)
Expand Down
2 changes: 1 addition & 1 deletion std_blocks/trig/ptrig.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const char* schedpol_tostr(unsigned int schedpol)
case SCHED_RR: return "SCHED_RR";
case SCHED_IDLE: return "SCHED_IDLE";
case SCHED_BATCH: return "SCHED_BATCH";
case SCHED_DEADLINE: return "SCHED_BATCH";
//case SCHED_DEADLINE: return "SCHED_BATCH";
default:
return "unkown";
}
Expand Down