Skip to content

Commit 517bcc2

Browse files
committed
Add in prmDb
1 parent 037d4cf commit 517bcc2

File tree

5 files changed

+9
-24
lines changed

5 files changed

+9
-24
lines changed

FprimeZephyrReference/ReferenceDeployment/Main.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#include <zephyr/kernel.h>
1111
#include <zephyr/sys/printk.h>
12-
#include <Os/File.hpp>
1312

1413
const struct device* serial = DEVICE_DT_GET(DT_NODELABEL(cdc_acm_uart0));
1514
const struct device* lora = DEVICE_DT_GET(DT_NODELABEL(lora0));
@@ -20,25 +19,6 @@ int main(int argc, char* argv[]) {
2019
// This sleep is necessary to allow the USB CDC ACM interface to initialize before
2120
// the application starts writing to it.
2221
k_sleep(K_MSEC(3000));
23-
Os::File file;
24-
U8 message[] = "Hello Ines\n";
25-
U8 message1[sizeof(message) + 1] = {0};
26-
Os::File::Status status;
27-
FwSizeType size;
28-
// = file.open("/tmp1", Os::File::Mode::OPEN_CREATE);
29-
// Os::File::Status status = file.open("/tmp1", Os::File::Mode::OPEN_CREATE);
30-
// FwSizeType size = static_cast<FwSignedSizeType>(sizeof(message));
31-
// printk("Status: %d - open\n", static_cast<int>(status));
32-
// status = file.write(message, size);
33-
// printk("Status: %d - write %" PRI_FwSizeType "\n", static_cast<int>(status), size);
34-
// file.close();
35-
status = file.open("/tmp1", Os::File::Mode::OPEN_READ);
36-
printk("Status: %d - open (R)\n", static_cast<int>(status));
37-
size = static_cast<FwSignedSizeType>(sizeof(message));
38-
status = file.read(message1, size);
39-
printk("Status: %d - read %" PRI_FwSizeType "\n", static_cast<int>(status), size);
40-
message1[sizeof(message)] = 0;
41-
printk("Message: %s\n", message1);
4222
Os::init();
4323
// Object for communicating state to the topology
4424
ReferenceDeployment::TopologyState inputs;

FprimeZephyrReference/ReferenceDeployment/Top/ReferenceDeploymentTopology.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ U32 rateGroup1HzContext[Svc::ActiveRateGroup::CONNECTION_COUNT_MAX] = {getRateGr
5050
* desired, but is extracted here for clarity.
5151
*/
5252
void configureTopology() {
53+
prmDb.configure("/prmDb.dat");
5354
// Rate group driver needs a divisor list
5455
rateGroupDriver.configure(rateGroupDivisorsSet);
5556
// Rate groups require context arrays.
@@ -77,6 +78,7 @@ void setupTopology(const TopologyState& state) {
7778
// Project-specific component configuration. Function provided above. May be inlined, if desired.
7879
configureTopology();
7980
// Autocoded parameter loading. Function provided by autocoder.
81+
prmDb.readParamFile();
8082
loadParameters();
8183
// Autocoded task kick-off (active components). Function provided by autocoder.
8284
startTasks(state);

FprimeZephyrReference/ReferenceDeployment/Top/instances.fpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ module ReferenceDeployment {
3737
stack size Default.STACK_SIZE \
3838
priority 4
3939

40+
instance prmDb: Svc.PrmDb base id 0x10003000 \
41+
queue size Default.QUEUE_SIZE \
42+
stack size Default.STACK_SIZE \
43+
priority 5
44+
4045
# ----------------------------------------------------------------------
4146
# Queued component instances
4247
# ----------------------------------------------------------------------
@@ -73,8 +78,6 @@ module ReferenceDeployment {
7378

7479
instance gpioBurnwire1: Zephyr.ZephyrGpioDriver base id 0x10023000
7580

76-
instance prmDb: Components.NullPrmDb base id 0x10024000
77-
7881
instance comDelay: Components.ComDelay base id 0x10025000
7982

8083
instance lora: Zephyr.LoRa base id 0x10026000

lib/fprime

Submodule fprime updated 77 files

lib/fprime-zephyr

0 commit comments

Comments
 (0)