Mateusz Lubecki 2023-06-30 23:01:36 +02:00
rodzic 0d5acc1d1b
commit 06d3375ea3
39 zmienionych plików z 123 dodań i 74 usunięć

Wyświetl plik

@ -86,7 +86,7 @@
</option>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.otherwarnings.1338324911" name="Other warning flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.otherwarnings" useByScannerDiscovery="true" value="-Wunused-function -Wall" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.asmlisting.1200792307" name="Generate assembler listing (-Wa,-adhlns=&quot;$@.lst&quot;)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.asmlisting" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.undef.1745924307" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.undef" valueType="undefDefinedSymbols">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.undef.1745924307" name="Undefined symbols (-U)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.undef" useByScannerDiscovery="true" valueType="undefDefinedSymbols">
<listOptionValue builtIn="false" value="PARAMETEO"/>
</option>
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.726748309" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/>
@ -220,8 +220,8 @@
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="include"/>
<entry excluding="button_parameteo.c|nvm.c|aprsis.c|api.c|pwr_save.c|Timer.cpp" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
<entry excluding="src/drivers/max31865.c|src/fatfs|src/gsm|src/cmsis/stm32l4xx|src/drivers/l4|src/stm32l4-hal-driver|src/dsp|src/stm32f1-stdperiph/stm32f10x_adc.c|src/stm32f1-stdperiph/stm32f10x_wwdg.c|src/drivers/tm_stm32fonewire/tm_stm32f1_onewire.c|src/stm32f1-stdperiph/stm32f10x_bkp.c|src/stm32f1-stdperiph/stm32f10x_dac.c|src/stm32f1-stdperiph/stm32f10x_can.c|src/stm32f1-stdperiph/stm32f10x_spi.c|src/stm32f1-stdperiph/stm32f10x_pwr.c|src/stm32f1-stdperiph/stm32f10x_sdio.c|src/stm32f1-stdperiph/stm32f10x_fsmc.c|src/stm32f1-stdperiph/stm32f10x_cec.c" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="system"/>
<entry excluding="button_parameteo.c|Timer.cpp|pwr_save.c|nvm.c|aprsis.c|api.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
<entry excluding="src/stm32f1-stdperiph/stm32f10x_dac.c|src/stm32f1-stdperiph/stm32f10x_adc.c|src/stm32f1-stdperiph/stm32f10x_can.c|src/drivers/l4|src/stm32f1-stdperiph/stm32f10x_pwr.c|src/stm32f1-stdperiph/stm32f10x_sdio.c|src/drivers/tm_stm32fonewire/tm_stm32f1_onewire.c|src/fatfs|src/cmsis/stm32l4xx|src/stm32f1-stdperiph/stm32f10x_fsmc.c|src/stm32l4-hal-driver|src/stm32f1-stdperiph/stm32f10x_spi.c|src/drivers/max31865.c|src/stm32f1-stdperiph/stm32f10x_wwdg.c|src/stm32f1-stdperiph/stm32f10x_cec.c|src/gsm|src/dsp|src/stm32f1-stdperiph/stm32f10x_bkp.c" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="system"/>
</sourceEntries>
</configuration>
</storageModule>
@ -503,8 +503,8 @@
<sourceEntries>
<entry excluding="api" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="include"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="include/api"/>
<entry excluding="button_paratnc.c|Timer.cpp" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
<entry excluding="src/newlib|src/drivers/f1|src/cmsis/vectors_stm32f10x.c|src/cmsis/system_stm32f10x.c|src/cortexm|src/stm32f1-stdperiph|src/stm32f1-stdperiph/stm32f10x_adc.c|src/stm32f1-stdperiph/stm32f10x_wwdg.c|src/drivers/tm_stm32fonewire/tm_stm32f1_onewire.c|src/stm32f1-stdperiph/stm32f10x_bkp.c|src/stm32f1-stdperiph/stm32f10x_dac.c|src/stm32f1-stdperiph/stm32f10x_can.c|src/stm32f1-stdperiph/stm32f10x_spi.c|src/stm32f1-stdperiph/stm32f10x_pwr.c|src/stm32f1-stdperiph/stm32f10x_sdio.c|src/stm32f1-stdperiph/stm32f10x_fsmc.c|src/stm32f1-stdperiph/stm32f10x_cec.c" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="system"/>
<entry excluding="Timer.cpp|button_paratnc.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
<entry excluding="src/stm32f1-stdperiph/stm32f10x_dac.c|src/stm32f1-stdperiph/stm32f10x_adc.c|src/stm32f1-stdperiph|src/drivers/f1|src/stm32f1-stdperiph/stm32f10x_can.c|src/cmsis/system_stm32f10x.c|src/stm32f1-stdperiph/stm32f10x_pwr.c|src/stm32f1-stdperiph/stm32f10x_sdio.c|src/drivers/tm_stm32fonewire/tm_stm32f1_onewire.c|src/stm32f1-stdperiph/stm32f10x_fsmc.c|src/stm32f1-stdperiph/stm32f10x_spi.c|src/cmsis/vectors_stm32f10x.c|src/cortexm|src/stm32f1-stdperiph/stm32f10x_wwdg.c|src/stm32f1-stdperiph/stm32f10x_cec.c|src/newlib|src/stm32f1-stdperiph/stm32f10x_bkp.c" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="system"/>
</sourceEntries>
</configuration>
</storageModule>
@ -562,16 +562,10 @@
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1905520139;ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1905520139.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.176156905;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.321079206">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1905520139;ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1905520139.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.879859241;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1662655990">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.827603628;ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.827603628.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.204317376;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.90169505">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.827603628.109360039;ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.827603628.109360039.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.270124285;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.29354374">
<scannerConfigBuildInfo instanceId="ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1905520139;ilg.gnuarmeclipse.managedbuild.cross.config.elf.release.1905520139.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.176156905;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.321079206">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.827603628;ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.827603628.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.1002686397;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.726748309">
@ -580,5 +574,11 @@
<scannerConfigBuildInfo instanceId="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.827603628.109360039;ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.827603628.109360039.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.1656265940;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.671886381">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.827603628.109360039;ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.827603628.109360039.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.270124285;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.29354374">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.827603628;ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.827603628.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.204317376;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.90169505">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
</cproject>

Wyświetl plik

@ -24,8 +24,8 @@ RM := rm -rf
-include system/src/cmsis/stm32l4xx/subdir.mk
-include system/src/aprs/subdir.mk
-include system/src/subdir.mk
-include src/stored_configuration_nvm/subdir.mk
-include src/kiss_protocol/subdir.mk
-include src/configuration_nvm/subdir.mk
-include src/subdir.mk
-include subdir.mk
-include objects.mk

Wyświetl plik

@ -28,8 +28,8 @@ CPP_DEPS :=
# Every subdirectory with source files must be described here
SUBDIRS := \
src \
src/configuration_nvm \
src/kiss_protocol \
src/stored_configuration_nvm \
system/src/aprs \
system/src/cmsis/stm32l4xx \
system/src \

Wyświetl plik

@ -8,8 +8,8 @@
#ifndef PATH_H_
#define PATH_H_
#include <stored_configuration_nvm/config_data.h>
#include "aprs/ax25.h"
#include "config_data.h"
/* C++ detection */
#ifdef __cplusplus

Wyświetl plik

@ -8,10 +8,10 @@
#ifndef APRSIS_H_
#define APRSIS_H_
#include <stored_configuration_nvm/config_data.h>
#include "drivers/serial.h"
#include "gsm/sim800c_tcpip.h"
#include "ax25.h"
#include "config_data.h"
typedef enum aprsis_return {

Wyświetl plik

@ -11,7 +11,7 @@
#ifndef BUTTON_H_
#define BUTTON_H_
#include "configuration_handler.h"
#include <stored_configuration_nvm/configuration_handler.h>
/**
* Should be called from main for loop or in quite short interval, like

Wyświetl plik

@ -28,14 +28,14 @@ extern char did_dummy_data;
//!< Definition of all DIDs with theirs source data for PARAMETEO platform
#if defined(PARAMETEO)
#define DIDS_NUMERIC(ENTRY) \
ENTRY(0x1234, &rte_wx_temperature_average_dallas, &rte_wx_temperature_average_pt, &rte_wx_temperature_average_internal) \
ENTRY(0xFFFF, &did_dummy_data, &did_dummy_data, &did_dummy_data)
ENTRY(0x1234U, &rte_wx_temperature_average_dallas, &rte_wx_temperature_average_pt, &rte_wx_temperature_average_internal) \
ENTRY(0xFFFFU, &did_dummy_data, &did_dummy_data, &did_dummy_data)
#endif
//!< Definition of all DIDs with theirs source data for PARATNC platform
#if defined (PARATNC)
#define DIDS_NUMERIC(ENTRY) \
ENTRY(0xFFFF, &did_dummy_data, &did_dummy_data, &did_dummy_data)
ENTRY(0xFFFFU, &did_dummy_data, &did_dummy_data, &did_dummy_data)
#endif
#endif /* KISS_DID_CONFIGURATION_H_ */

Wyświetl plik

@ -10,6 +10,7 @@
#ifndef KISS_COMMUNICATION_KISS_COMMUNICATION_NRC_T_H_
#define KISS_COMMUNICATION_KISS_COMMUNICATION_NRC_T_H_
#define KISS_COMMUNICATION_NRC_SERVICE 0x74U
typedef enum kiss_communication_nrc_t {
NRC_POSITIVE = 0x00,
@ -124,6 +125,19 @@ typedef enum kiss_communication_nrc_t {
*/
NRC_EXCEED_NUMBER_OF_ATTEMPTS = 0x36,
/**
* This response code indicates that an attempt to upload/download to
* a server's memory cannot be accomplished due to some fault conditions.
*/
NRC_UPLOAD_DOWNLOAD_NOT_ACCEPTED = 0x70,
/**
* This response code indicates that the server detected an error when
* erasing or programming a memory location in the permanent memory
* device (e.g. Flash Memory).
*/
NRC_GENERAL_PROGRAMMING_FAIL = 0x72,
/**
* This response code indicates that the request message was received
* correctly, and that all parameters in the request message were valid,

Wyświetl plik

@ -1,13 +1,13 @@
#ifndef MAIN_H_
#define MAIN_H_
#include <stored_configuration_nvm/config_data.h>
#include "main_master_time.h"
#include "station_config_target_hw.h"
#include "aprs/ax25.h"
#include "drivers/serial.h"
#include "config_data.h"
#include "gsm/sim800_state_t.h"
#define SW_VER "EA23"

Wyświetl plik

@ -8,7 +8,7 @@
#ifndef PACKET_TX_HANDLER_H_
#define PACKET_TX_HANDLER_H_
#include "config_data.h"
#include <stored_configuration_nvm/config_data.h>
typedef struct packet_tx_counter_values_t {

Wyświetl plik

@ -8,6 +8,7 @@
#ifndef PWR_SAVE_H_
#define PWR_SAVE_H_
#include <stored_configuration_nvm/config_data.h>
#include "station_config_target_hw.h"
/**
@ -102,7 +103,6 @@
*
*/
#include "config_data.h"
#define CURRENTLY_CUTOFF 0x1
#define CURRENTLY_VBATT_LOW 0x8

Wyświetl plik

@ -8,7 +8,7 @@
#ifndef CONFIG_DATA_EXTERNS_H_
#define CONFIG_DATA_EXTERNS_H_
#include "config_data.h"
#include <stored_configuration_nvm/config_data.h>
extern const int __config_section_first_crc;
extern const int __config_section_second_crc;

Wyświetl plik

@ -9,6 +9,8 @@
#define CONFIGURATION_HANDLER_H_
#include <stdint.h>
#include "kiss_communication_nrc_t.h"
typedef enum configuration_handler_region_t {
REGION_DEFAULT,
@ -39,8 +41,8 @@ uint32_t configuration_handler_check_crc(void);
uint32_t configuration_handler_restore_default_first(void);
uint32_t configuration_handler_restore_default_second(void);
void configuration_handler_load_configuration(configuration_handler_region_t region);
configuration_erase_startup_t configuration_handler_erase_startup(void);
configuration_erase_startup_t configuration_handler_program_startup(uint8_t * data, uint8_t dataln, uint16_t offset);
kiss_communication_nrc_t configuration_handler_erase_startup(void);
kiss_communication_nrc_t configuration_handler_program_startup(uint8_t * data, uint8_t dataln, uint16_t offset);
uint32_t configuration_get_register(void);
void configuration_set_register(uint32_t value);

Wyświetl plik

@ -9,7 +9,7 @@
#define WX_HANDLER_H_
#include <stdint.h>
#include "config_data.h"
#include <stored_configuration_nvm/config_data.h>
extern uint32_t wx_last_good_temperature_time;
extern uint32_t wx_last_good_wind_time;

Wyświetl plik

@ -8,7 +8,7 @@
#ifndef WX_HANDLER_HUMIDITY_H_
#define WX_HANDLER_HUMIDITY_H_
#include "config_data.h"
#include <stored_configuration_nvm/config_data.h>
int32_t wx_get_humidity_measurement(const config_data_wx_sources_t * const config_sources, const config_data_mode_t * const config_mode, const config_data_umb_t * const config_umb, const config_data_rtu_t * const config_rtu);
int32_t wx_get_humidity_bme280(int8_t * const humidity);

Wyświetl plik

@ -8,7 +8,7 @@
#ifndef WX_HANDLER_PRESSURE_H_
#define WX_HANDLER_PRESSURE_H_
#include "config_data.h"
#include <stored_configuration_nvm/config_data.h>
int32_t wx_get_pressure_measurement(const config_data_wx_sources_t * const config_sources, const config_data_mode_t * const config_mode, const config_data_umb_t * const config_umb, const config_data_rtu_t * const config_rtu);
int32_t wx_get_pressure_ms5611(float * const pressure);

Wyświetl plik

@ -8,7 +8,7 @@
#ifndef WX_HANDLER_TEMPERATURE_H_
#define WX_HANDLER_TEMPERATURE_H_
#include "config_data.h"
#include <stored_configuration_nvm/config_data.h>
int32_t wx_get_temperature_measurement(const config_data_wx_sources_t * const config_sources, const config_data_mode_t * const config_mode, const config_data_umb_t * const config_umb, const config_data_rtu_t * const config_rtu, float * output);
int32_t wx_get_temperature_dallas(void);

Wyświetl plik

@ -40,7 +40,7 @@
#include "rte_main.h"
#include <configuration_nvm/configuration_handler.h>
#include <stored_configuration_nvm/configuration_handler.h>
#include "station_config.h"

Wyświetl plik

@ -1,17 +1,21 @@
/*
* kiss_callback.c
*
* This file contains callback to all async sudo-UDS services requests. Each
* callback takes pointer for buffer and response. It returns a size of a
* response.
*
* Created on: Aug 17, 2022
* Author: mateusz
*/
#include <configuration_nvm/configuration_handler.h>
#include <kiss_communication/kiss_communication.h>
#include <kiss_communication/kiss_communication_service_ids.h>
#include "main.h"
#include <string.h>
#include <stdio.h>
#include <stored_configuration_nvm/configuration_handler.h>
#define KISS_MAX_CONFIG_PAYLOAD_SIZE 0x80
#define KISS_LAST_ASYNC_MSG 0xFF
@ -139,14 +143,14 @@ int32_t kiss_callback_erase_startup(uint8_t* input_frame_from_host, uint16_t inp
#define ERASE_STARTUP_LN 6
configuration_erase_startup_t result = configuration_handler_erase_startup();
kiss_communication_nrc_t result = configuration_handler_erase_startup();
// construct a response
response_buffer[0] = FEND;
response_buffer[1] = NONSTANDARD;
response_buffer[2] = ERASE_STARTUP_LN; // message lenght
response_buffer[3] = KISS_ERASE_STARTUP_CFG_RESP;
response_buffer[4] = result;
response_buffer[4] = (uint8_t)result;
response_buffer[5] = FEND;
return ERASE_STARTUP_LN;
@ -154,15 +158,15 @@ int32_t kiss_callback_erase_startup(uint8_t* input_frame_from_host, uint16_t inp
/**
* Callback which program configuration data block received from the Host PC. Please bear in mind that the TNC doesn't really take care
* what it receices and program. It is up to host PC to provide senseful configuration with properly calculated checksum as this isn't
* recalculated ruing programming.
* what it receives and program. It is up to host PC to provide senseful configuration with properly calculated checksum as this isn't
* recalculated during programming.
*/
int32_t kiss_callback_program_startup(uint8_t* input_frame_from_host, uint16_t input_len, uint8_t* response_buffer, uint16_t buffer_size) {
#define PROGRAM_STARTUP_LN 6
/**
* The structure of input frame goes like that:
* The structure of an input frame goes like that:
* FEND, KISS_PROGRAM_STARTUP_CFG, data_PAYLOAD_LN, OFFSET_LSB, OFFSET_MSB, data, data, (...), FEND
*
* KISS_PROGRAM_STARTUP_CFG is a frame type, in this case 0x34, but might be also 0x00 for regular
@ -172,7 +176,7 @@ int32_t kiss_callback_program_startup(uint8_t* input_frame_from_host, uint16_t i
*/
// result to be returned to the host PC
configuration_erase_startup_t result;
kiss_communication_nrc_t result;
// offset within input frame where config start begining
uint8_t * data_ptr = input_frame_from_host + 5;
@ -189,7 +193,7 @@ int32_t kiss_callback_program_startup(uint8_t* input_frame_from_host, uint16_t i
response_buffer[1] = NONSTANDARD;
response_buffer[2] = PROGRAM_STARTUP_LN; // message lenght
response_buffer[3] = KISS_PROGRAM_STARTUP_CFG_RESP;
response_buffer[4] = result;
response_buffer[4] = (uint8_t)result;
response_buffer[5] = FEND;
return PROGRAM_STARTUP_LN;

Wyświetl plik

@ -5,8 +5,6 @@
* Author: mateusz
*/
#include <configuration_nvm/config_data_externs.h>
#include <configuration_nvm/configuration_handler.h>
#include "main.h"
#include "station_config.h"
@ -17,6 +15,8 @@
#include <kiss_communication/kiss_communication_service_ids.h>
#include <string.h>
#include <stdlib.h>
#include <stored_configuration_nvm/config_data_externs.h>
#include <stored_configuration_nvm/configuration_handler.h>
extern unsigned short tx10m;
@ -26,6 +26,17 @@ extern unsigned short tx10m;
*/
uint8_t kiss_current_async_message = 0xFF;
#define KISS_NRC_RESPONSE_UNKNOWN_SERVICE_LN 6
//!< Neagitve response to a request with unknown service id
uint8_t kiss_nrc_response_unknown_service[KISS_NRC_RESPONSE_UNKNOWN_SERVICE_LN] = {
FEND,
NONSTANDARD,
KISS_NRC_RESPONSE_UNKNOWN_SERVICE_LN,
KISS_COMMUNICATION_NRC_SERVICE,
NRC_SERVICE_NOT_SUPPORTED,
FEND};
uint8_t kiss_async_pooler(uint8_t* output, uint16_t output_len ) {
@ -183,6 +194,7 @@ int32_t kiss_parse_received(uint8_t* input_frame_from_host, uint16_t input_len,
default: {
// unknown service
output = -3;
}
}

Wyświetl plik

@ -26,7 +26,7 @@ typedef struct kiss_did_numeric_definition_t {
}kiss_did_numeric_definition_t;
//!< Definition of all DIDs with numeric data
const kiss_did_numeric_definition_t kiss_did_def[] = {
const static kiss_did_numeric_definition_t kiss_did_def[] = {
DIDS_NUMERIC(DID_NUMERIC_DEFINITION_EXPANDER)
};
@ -42,5 +42,23 @@ const kiss_did_numeric_definition_t kiss_did_def[] = {
*/
void kiss_did_response(uint16_t identifier, uint8_t * output_buffer, uint16_t buffer_ln) {
// iterator to go through DID definition
int i = 0;
// data of a did found in configuration
kiss_did_numeric_definition_t found = {.identifier = 0xFFFFu};
// iterate through DID definition and check if this id exist there
do {
// check if current position is the DID we're looking for
if (kiss_did_def[i].identifier == identifier) {
// if yes copy this data and exit the loop
found = kiss_did_def[i];
}
else {
// if no, go to the next DID definition
i++;
}
} while (kiss_did_def[i].identifier != 0xFFFFU);
}

Wyświetl plik

@ -39,8 +39,8 @@
#include "packet_tx_handler.h"
#include "station_config.h"
#include <configuration_nvm/config_data_externs.h>
#include <configuration_nvm/configuration_handler.h>
#include <stored_configuration_nvm/config_data_externs.h>
#include <stored_configuration_nvm/configuration_handler.h>
#include "diag/Trace.h"
#include "antilib_adc.h"

Wyświetl plik

@ -9,7 +9,7 @@
// configuration data (CRC32 calculated from both sections is wrong). In such case the software erases both sections and
// reprogram it from the default set stored somewhere within .code section
#include <configuration_nvm/config_data.h>
#include <stored_configuration_nvm/config_data.h>
#include "io_default_vbat_scaling.h"
#include "station_config.h"

Wyświetl plik

@ -10,7 +10,7 @@
* Please look at 'station_config.h' instead to set all parameters.
*/
#include <configuration_nvm/config_data.h>
#include <stored_configuration_nvm/config_data.h>
#include "io_default_vbat_scaling.h"
#include "station_config.h"

Wyświetl plik

@ -5,7 +5,7 @@
* Author: mateusz
*/
#include <configuration_nvm/config_data.h>
#include <stored_configuration_nvm/config_data.h>
#include "io_default_vbat_scaling.h"
#include "station_config.h"

Wyświetl plik

@ -5,10 +5,9 @@
* Author: mateusz
*/
#include <configuration_nvm/config_data.h>
#include <configuration_nvm/config_data_externs.h>
#include <configuration_nvm/configuration_handler.h>
#include "station_config_target_hw.h"
#include <stored_configuration_nvm/config_data.h>
#include <stored_configuration_nvm/config_data_externs.h>
#include <stored_configuration_nvm/configuration_handler.h>
#include "io_default_vbat_scaling.h"
@ -642,7 +641,7 @@ void configuration_handler_load_configuration(configuration_handler_region_t reg
}
configuration_erase_startup_t configuration_handler_erase_startup(void) {
kiss_communication_nrc_t configuration_handler_erase_startup(void) {
// flash operation result
FLASH_Status flash_status = 0;
@ -655,7 +654,7 @@ configuration_erase_startup_t configuration_handler_erase_startup(void) {
page_address = (uint32_t)config_section_first_start;
}
else {
return ERASE_STARTUP_IDLE;
return NRC_UPLOAD_DOWNLOAD_NOT_ACCEPTED;
}
@ -671,14 +670,14 @@ configuration_erase_startup_t configuration_handler_erase_startup(void) {
FLASH_Lock();
if (flash_status == FLASH_COMPLETE) {
return ERASE_STARTUP_DONE;
return NRC_POSITIVE;
}
else {
return ERASE_STARTUP_ERROR;
return NRC_GENERAL_PROGRAMMING_FAIL;
}
}
configuration_erase_startup_t configuration_handler_program_startup(uint8_t * data, uint8_t dataln, uint16_t offset) {
kiss_communication_nrc_t configuration_handler_program_startup(uint8_t * data, uint8_t dataln, uint16_t offset) {
int comparision_result;
@ -698,11 +697,11 @@ configuration_erase_startup_t configuration_handler_program_startup(uint8_t * da
target = (void *)config_section_first_start + offset;
}
else {
return ERASE_STARTUP_IDLE;
return NRC_UPLOAD_DOWNLOAD_NOT_ACCEPTED;
}
if ((dataln % 8) != 0) {
return ERASE_STARTUP_IDLE;
return NRC_UPLOAD_DOWNLOAD_NOT_ACCEPTED;
}
@ -715,16 +714,16 @@ configuration_erase_startup_t configuration_handler_program_startup(uint8_t * da
comparision_result = memcmp((const void * )target, (const void * )source, dataln);
if (comparision_result == 0) {
return ERASE_STARTUP_DONE;
return NRC_POSITIVE;
}
else {
return ERASE_STARTUP_ERROR;
return NRC_GENERAL_PROGRAMMING_FAIL;
}
return ERASE_STARTUP_DONE;
return NRC_POSITIVE;
}
else {
return ERASE_STARTUP_ERROR;
return NRC_GENERAL_PROGRAMMING_FAIL;
}
}

Wyświetl plik

@ -8,7 +8,7 @@
#ifndef INCLUDE_APRS_DIGI_H_
#define INCLUDE_APRS_DIGI_H_
#include <configuration_nvm/config_data.h>
#include <stored_configuration_nvm/config_data.h>
#include "aprs/ax25.h"
#define DIGI_PACKET_DIGIPEATED 1

Wyświetl plik

@ -8,7 +8,7 @@
#ifndef INCLUDE_APRS_TELEMETRY_H_
#define INCLUDE_APRS_TELEMETRY_H_
#include <configuration_nvm/config_data.h>
#include <stored_configuration_nvm/config_data.h>
#include "./drivers/dallas.h"
#include "./drivers/ms5611.h"
#include "./umb_master/umb_qf_t.h"

Wyświetl plik

@ -8,10 +8,10 @@
#ifndef INCLUDE_DRIVERS_MAX31865_H_
#define INCLUDE_DRIVERS_MAX31865_H_
#include <configuration_nvm/config_data.h>
#include "drivers/spi.h"
#include <stdint.h>
#include <stored_configuration_nvm/config_data.h>
#define MAX_3WIRE 3
#define MAX_4WIRE 1

Wyświetl plik

@ -9,7 +9,7 @@
#define INCLUDE_GSM_SIM800C_GPRS_H_
#include <configuration_nvm/config_data.h>
#include <stored_configuration_nvm/config_data.h>
#include "drivers/serial.h"
#include "gsm/sim800_state_t.h"

Wyświetl plik

@ -8,7 +8,7 @@
#ifndef INCLUDE_GSM_SIM800C_POOLERS_H_
#define INCLUDE_GSM_SIM800C_POOLERS_H_
#include <configuration_nvm/config_data.h>
#include <stored_configuration_nvm/config_data.h>
#include "drivers/serial.h"
#include "gsm/sim800_state_t.h"

Wyświetl plik

@ -8,8 +8,8 @@
#ifndef INCLUDE_MODBUS_RTU_RTU_GETTERS_H_
#define INCLUDE_MODBUS_RTU_RTU_GETTERS_H_
#include <configuration_nvm/config_data.h>
#include <stdint.h>
#include <stored_configuration_nvm/config_data.h>
int32_t rtu_get_temperature(int16_t* out, const config_data_rtu_t * const config);
int32_t rtu_get_pressure(float* out, const config_data_rtu_t * const config);

Wyświetl plik

@ -8,8 +8,8 @@
#ifndef INCLUDE_MODBUS_RTU_RTU_SERIAL_IO_H_
#define INCLUDE_MODBUS_RTU_RTU_SERIAL_IO_H_
#include <configuration_nvm/config_data.h>
#include <stdint.h>
#include <stored_configuration_nvm/config_data.h>
#include "./drivers/serial.h"

Wyświetl plik

@ -8,7 +8,7 @@
#ifndef INCLUDE_UMB_MASTER_UMB_0X23_OFFLINE_DATA_H_
#define INCLUDE_UMB_MASTER_UMB_0X23_OFFLINE_DATA_H_
#include <configuration_nvm/config_data.h>
#include <stored_configuration_nvm/config_data.h>
#include "./umb_master/umb_retval_t.h"
#include "./umb_master/umb_frame_t.h"
#include "./umb_master/umb_context_t.h"

Wyświetl plik

@ -8,7 +8,7 @@
#ifndef INCLUDE_UMB_MASTER_UMB_0X26_STATUS_H_
#define INCLUDE_UMB_MASTER_UMB_0X26_STATUS_H_
#include <configuration_nvm/config_data.h>
#include <stored_configuration_nvm/config_data.h>
#include "../umb_master/umb_retval_t.h"
#include "../umb_master/umb_context_t.h"
#include "../umb_master/umb_frame_t.h"

Wyświetl plik

@ -8,7 +8,7 @@
#ifndef INCLUDE_UMB_MASTER_UMB_CHANNEL_POOL_H_
#define INCLUDE_UMB_MASTER_UMB_CHANNEL_POOL_H_
#include <configuration_nvm/config_data.h>
#include <stored_configuration_nvm/config_data.h>
#include "umb_context_t.h"
#include "umb_frame_t.h"

Wyświetl plik

@ -8,7 +8,7 @@
#ifndef INCLUDE_UMB_MASTER_UMB_MASTER_H_
#define INCLUDE_UMB_MASTER_UMB_MASTER_H_
#include <configuration_nvm/config_data.h>
#include <stored_configuration_nvm/config_data.h>
#include <umb_master/umb_frame_t.h>
#include <umb_master/umb_retval_t.h>
#include <umb_master/umb_context_t.h>

Wyświetl plik

@ -5,7 +5,7 @@
* Author: mateusz
*/
#include <configuration_nvm/config_data.h>
#include <stored_configuration_nvm/config_data.h>
#include "../umb_master/umb_master.h"
#include "../umb_master/umb_0x26_status.h"
#include "main.h"