Skip to content

feat: define receive queue sizing constant - #17

Open
rureverek wants to merge 2 commits into
mainfrom
feat/receive_queue_item_constant
Open

feat: define receive queue sizing constant#17
rureverek wants to merge 2 commits into
mainfrom
feat/receive_queue_item_constant

Conversation

@rureverek

Copy link
Copy Markdown

Changes

  • Small change: defines receive notification queue sizing constant

Related Issue(s)

Closes#15

@rureverek
rureverek requested a review from t-breFebruary 17, 2023 12:09
@rureverekrureverek changed the title Define receive queue sizing constantfeat: define receive queue sizing constantFeb 17, 2023
@t-bret-bre self-assigned this Feb 17, 2023
@t-bret-bre added the feature New feature or request label Feb 17, 2023
@t-bret-bre added this to the STAG 9 milestone Feb 17, 2023
Comment threadinc/rtcan.h Outdated

#define RTCAN_RX_NOTIF_QUEUE_LENGTH 10
#define RTCAN_RX_NOTIF_QUEUE_ITEM_SIZE 1 // one pointer = 1x ULONG
#define RTCAN_RX_NOTIF_QUEUE_ITEM_SIZE (sizeof(rtcan_msg_t*) / sizeof(ULONG)) // one pointer = 1x ULONG

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the right constant value, but I don't think this should be the name of the constant that users use in their code. This particular group of constants is internal to RTCAN (used to send pointers to received messages to the RTCAN Rx thread for dispatch to subscribers).

I suggest:

// user constant#defineRTCAN_RX_QUEUE_ITEM_SIZE (sizeof(rtcan_msg_t*) / sizeof(ULONG))
// internal constant#defineRTCAN_RX_NOTIF_QUEUE_ITEM_SIZE (RTCAN_RX_QUEUE_ITEM_SIZE)

I think we should perhaps rename all of the internal constants, or #undef them at the end of the header so they don't get exposed to users and potentially cause confusion. Maybe they should be prefixed with an underscore if they are internal?

@rureverek
rureverek requested a review from t-breFebruary 27, 2023 13:20
@AvdieienkoAvdieienko removed this from the STAG 9 milestone Dec 12, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

featureNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: define receive queue item sizing constant in rtcan.h

3 participants

@rureverek@t-bre@Avdieienko