Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support UNSIGNED48 and friends #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion include/co_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ typedef uint32_t (*co_access_fn) (
const struct co_obj * obj, /**< object descriptor */
const struct co_entry * entry, /**< entry descriptor */
uint8_t subindex, /**< subindex */
uint32_t * value /**< value to set or get */
uint64_t * value /**< value to set or get */
);

/** Entry descriptor. Describes a subindex, or a series of subindexes
Expand Down
42 changes: 21 additions & 21 deletions include/co_obj.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ CO_EXPORT uint32_t co_od1001_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

/**
* Access function for Pre-defined error field object (1003h)
Expand All @@ -129,7 +129,7 @@ CO_EXPORT uint32_t co_od1003_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

/**
* Access function for COB-ID SYNC message object (1005h)
Expand All @@ -149,7 +149,7 @@ CO_EXPORT uint32_t co_od1005_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

/**
* Access function for Commmunication cycle object (1006h)
Expand All @@ -169,7 +169,7 @@ CO_EXPORT uint32_t co_od1006_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

/**
* Access function for Synchronous window length object (1007h)
Expand All @@ -189,7 +189,7 @@ CO_EXPORT uint32_t co_od1007_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

/**
* Access function for Guard time object (100Ch)
Expand All @@ -209,7 +209,7 @@ CO_EXPORT uint32_t co_od100C_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

/**
* Access function for Life time factor object (100Dh)
Expand All @@ -229,7 +229,7 @@ CO_EXPORT uint32_t co_od100D_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

/**
* Access function for Store Parameters object (1010h)
Expand All @@ -249,7 +249,7 @@ CO_EXPORT uint32_t co_od1010_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

/**
* Access function for Restore Default Parameters object (1011h)
Expand All @@ -269,7 +269,7 @@ CO_EXPORT uint32_t co_od1011_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

/**
* Access function for COB-ID EMCY object (1014h)
Expand All @@ -289,7 +289,7 @@ CO_EXPORT uint32_t co_od1014_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

/**
* Access function for Inhibit time EMCY object (1015h)
Expand All @@ -309,7 +309,7 @@ CO_EXPORT uint32_t co_od1015_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

/**
* Access function for Consumer heartbeat time object (1016h)
Expand All @@ -329,7 +329,7 @@ CO_EXPORT uint32_t co_od1016_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

/**
* Access function for Producer heartbeat time object (1017h)
Expand All @@ -349,7 +349,7 @@ CO_EXPORT uint32_t co_od1017_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

/**
* Access function for Synchronous counter overflow value object (1019h)
Expand All @@ -369,7 +369,7 @@ CO_EXPORT uint32_t co_od1019_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

/**
* Access function for Verify Configuration object (1020h)
Expand All @@ -389,7 +389,7 @@ CO_EXPORT uint32_t co_od1020_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

/**
* Access function for Emergency consumer object (1028h)
Expand All @@ -409,7 +409,7 @@ CO_EXPORT uint32_t co_od1028_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

/**
* Access function for Error behavior object (1029h)
Expand All @@ -429,7 +429,7 @@ CO_EXPORT uint32_t co_od1029_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

/**
* Access function for RPDO communication parameter object (1400h - 15FFh)
Expand All @@ -449,7 +449,7 @@ CO_EXPORT uint32_t co_od1400_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

/**
* Access function for RPDO mapping parameter object (1600h - 17FFh)
Expand All @@ -469,7 +469,7 @@ CO_EXPORT uint32_t co_od1600_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

/**
* Access function for TPDO communication parameter object (1800h - 19FFh)
Expand All @@ -489,7 +489,7 @@ CO_EXPORT uint32_t co_od1800_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

/**
* Access function for RPDO mapping parameter object (1A00h - 1BFFh)
Expand All @@ -509,7 +509,7 @@ CO_EXPORT uint32_t co_od1A00_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value);
uint64_t * value);

#ifdef __cplusplus
}
Expand Down
23 changes: 15 additions & 8 deletions src/co_emcy.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "co_nmt.h"
#include "co_sdo.h"
#include "co_util.h"
#include "co_obj.h"

#include <string.h>

Expand Down Expand Up @@ -84,7 +85,7 @@ uint32_t co_od1001_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value)
uint64_t * value)
{
if (event == OD_EVENT_READ)
*value = co_emcy_error_register_get (net);
Expand All @@ -97,14 +98,20 @@ uint32_t co_od1003_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value)
uint64_t * value)
{
uint32_t retval;
uint32_t v;
switch (event)
{
case OD_EVENT_READ:
return co_emcy_error_get (net, subindex, value);
retval = co_emcy_error_get (net, subindex, &v);
if (retval == 0)
*value = v;
return retval;
case OD_EVENT_WRITE:
return co_emcy_error_set (net, subindex, value);
v = *value;
return co_emcy_error_set (net, subindex, &v);
case OD_EVENT_RESTORE:
net->number_of_errors = 0;
return 0;
Expand All @@ -119,7 +126,7 @@ uint32_t co_od1014_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value)
uint64_t * value)
{
switch (event)
{
Expand All @@ -145,7 +152,7 @@ uint32_t co_od1015_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value)
uint64_t * value)
{
switch (event)
{
Expand All @@ -169,7 +176,7 @@ uint32_t co_od1028_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value)
uint64_t * value)
{
uint32_t cobid;

Expand Down Expand Up @@ -204,7 +211,7 @@ uint32_t co_od1029_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value)
uint64_t * value)
{
switch (event)
{
Expand Down
5 changes: 3 additions & 2 deletions src/co_heartbeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "co_sdo.h"
#include "co_emcy.h"
#include "co_util.h"
#include "co_obj.h"

#include <string.h>

Expand All @@ -32,7 +33,7 @@ uint32_t co_od1017_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value)
uint64_t * value)
{
switch (event)
{
Expand All @@ -56,7 +57,7 @@ uint32_t co_od1016_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value)
uint64_t * value)
{
co_heartbeat_t * heartbeat = &net->heartbeat[subindex - 1];

Expand Down
5 changes: 3 additions & 2 deletions src/co_node_guard.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@
#include "co_sdo.h"
#include "co_emcy.h"
#include "co_util.h"
#include "co_obj.h"

uint32_t co_od100C_fn (
co_net_t * net,
od_event_t event,
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value)
uint64_t * value)
{
switch (event)
{
Expand All @@ -54,7 +55,7 @@ uint32_t co_od100D_fn (
const co_obj_t * obj,
const co_entry_t * entry,
uint8_t subindex,
uint32_t * value)
uint64_t * value)
{
switch (event)
{
Expand Down
Loading