- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to figure out what this does.
located in the hids.c file;
line 220 keyboard_data[2u] = 0u; /* Set up keyboard data*/
line 221 keyboard_data[3u] = 0u; /* Set up keyboard data*/
What is the purpose of these two lines?
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Welcome in the forum!
The trailing 'u' after an integer constant advises the compiler to treat the number as an "unsigned" item. To use this qualifier after every constant (if needed or not) conforms to the "MISRA" coding rules which imho do not make readability easier. Companies as Cypress are bound to follow these rules. So the above lies could have been written as
line 220 keyboard_data[2] = 0; /* Set up keyboard data*/
line 221 keyboard_data[3] = 0; /* Set up keyboard data*/
which is more the usual C-language style.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Welcome in the forum!
The trailing 'u' after an integer constant advises the compiler to treat the number as an "unsigned" item. To use this qualifier after every constant (if needed or not) conforms to the "MISRA" coding rules which imho do not make readability easier. Companies as Cypress are bound to follow these rules. So the above lies could have been written as
line 220 keyboard_data[2] = 0; /* Set up keyboard data*/
line 221 keyboard_data[3] = 0; /* Set up keyboard data*/
which is more the usual C-language style.
Bob