Fix UMP logger boot initialization and configurable protocol build
This commit is contained in:
@@ -42,6 +42,7 @@ void clear_mem();
|
||||
#define UMP_LOG_LIVE_RECORDS (120U / UMP_LOG_WORDS)
|
||||
#define UMP_LOG_LIVE 0x1100U
|
||||
extern unsigned int ump_dac_ramp, ump_dac_duration, ump_dac_go10, ump_dac_stop10, ump_dac_position;
|
||||
void ump_log_init(void);
|
||||
void ump_log_tick(void);
|
||||
void ump_log_io(void);
|
||||
void ump_log_can(unsigned int header, unsigned int a, unsigned int b, unsigned int c);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#ifndef UMP_CAN_PROTOCOL_H
|
||||
#define UMP_CAN_PROTOCOL_H
|
||||
#include "log_to_mem.h"
|
||||
#include "../../../../../templates/c/set-protocol/ports/tms320f28335/ump_tms28335.h"
|
||||
#include "ump_tms28335.h"
|
||||
#define UMP_CAN_MARKER UMP_MARKER
|
||||
#define UMP_CAN_MAX_WORDS UMP_MAX_WORDS
|
||||
#define ump_can_prepare ump_tms28335_prepare
|
||||
|
||||
@@ -51,6 +51,26 @@ extern int CanTimeOutErrorTR;
|
||||
* не пересчитывает и не изменяет управляющий алгоритм. */
|
||||
unsigned int ump_dac_ramp, ump_dac_duration, ump_dac_go10, ump_dac_stop10, ump_dac_position;
|
||||
|
||||
/* Called once at boot, before enabling interrupts. TI COFF startup does
|
||||
* not clear uninitialized globals in .ebss. Do not use for record restart:
|
||||
* restart must preserve the archive, time and latest received voltages. */
|
||||
void ump_log_init(void)
|
||||
{
|
||||
unsigned int i;
|
||||
ump_state = 0; ump_count = 0; ump_cursor = 0; ump_next = 0;
|
||||
ump_period = 20; ump_divider = 0;
|
||||
ump_time = 0; ump_sequence = 0;
|
||||
ump_bank = 0; ump_archive_bank = 1;
|
||||
ump_archive_count = 0; ump_archive_next = 0; ump_generation = 0;
|
||||
ump_source = 0; ump_post = 0; ump_post_dropped = 0;
|
||||
ump_can_header = 0; ump_can_count = 0;
|
||||
for (i = 0; i < 3; i++) ump_can_data[i] = 0;
|
||||
for (i = 0; i < 2; i++) ump_pm67_voltage[i] = 0;
|
||||
ump_prev_commands = 0; ump_prev_inputs = 0; ump_prev_outputs = 0;
|
||||
ump_dac_ramp = 0; ump_dac_duration = 0; ump_dac_go10 = 0;
|
||||
ump_dac_stop10 = 0; ump_dac_position = 0;
|
||||
}
|
||||
|
||||
/* Логические уровни входов платы нагрузки: физический ноль означает 1.
|
||||
* Чтение GPIO непосредственно здесь позволяет записать вход до следующего
|
||||
* обновления регистра Inputs в основном цикле. */
|
||||
|
||||
@@ -82,6 +82,7 @@ void main()
|
||||
unsetup_leds_line();
|
||||
|
||||
clear_mem();
|
||||
ump_log_init();
|
||||
set_cntrl_addr(Mode,16);
|
||||
timer_Init();
|
||||
EnableInterrupts();
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#include "caliber.h"
|
||||
#include "log_to_mem.h"
|
||||
#include "../../../../templates/c/set-protocol/ports/tms320f28335/ump_tms28335.h"
|
||||
#include "ump_tms28335.h"
|
||||
|
||||
int modbus[ANSWER_LEN+1];
|
||||
unsigned int param[ANSWER_LEN+1];
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
/* Build the canonical sources directly; do not copy their implementations. */
|
||||
#include "../../../../templates/c/set-protocol/src/ump_protocol.c"
|
||||
#include "../../../../templates/c/set-protocol/ports/tms320f28335/ump_tms28335.c"
|
||||
#include "src/ump_protocol.c"
|
||||
#include "ports/tms320f28335/ump_tms28335.c"
|
||||
|
||||
Reference in New Issue
Block a user