20 lines
488 B
C
Executable File
20 lines
488 B
C
Executable File
#include <rb2/regbus.h>
|
|
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
uint8_t rb2_default_register_proc(RB2_REGISTER *reg,RB2_TELEGRAM *telegram) {
|
|
if (telegram->flags.read) {
|
|
if (telegram->flags.type == RDT_FP4816)
|
|
telegram->flags.type = RDT_FLOAT;
|
|
|
|
rb2_convert( reg->register_type, reg->ptr, telegram->flags.type, &(telegram->i32) );
|
|
return 0;
|
|
} else {
|
|
rb2_convert( telegram->flags.type, &(telegram->i32), reg->register_type, reg->ptr );
|
|
return 0;
|
|
};
|
|
|
|
return -1;
|
|
};
|