uint8_t Values[4]={0};
uint8_t Loc=0;
uint32_t Mask=0xFF; //32 bits UART Rx Buffer size
for(uint8_t i=0;i<=24;i+=8)
{
Values[Loc]=(((Mask<<i) & UartRxBuf) >> i);
Loc++;
}
More Related Contents:
- How dangerous is it to access an array out of bounds?
- The need for parentheses in macros in C [duplicate]
- Are there machines, where sizeof(char) != 1, or at least CHAR_BIT > 8?
- Is a^a or a-a undefined behaviour if a is not initialized?
- Rounding up to next power of 2
- How do you format an unsigned long long int using printf?
- Why is the .bss segment required?
- How to copy a char array in C?
- Understanding container_of macro in the Linux kernel
- What’s the difference between a file descriptor and file pointer?
- Why does this code segfault on 64-bit architecture but work fine on 32-bit?
- Is there a typical state machine implementation pattern?
- Using poll function with buffered streams
- strcpy() return value
- Why array type object is not modifiable?
- setvbuf not able to make stdin unbuffered
- Difference between section and task openmp
- How to break out of nested loops?
- Finding out what the GCC include path is [duplicate]
- Why is the conditional operator right associative?
- Why does adding a small float to a large float just drop the small one?
- C Typedef and Struct Question
- What is the default C -std standard version for the current GCC (especially on Ubuntu)?
- Difference between C standard library and C POSIX library
- Why is the compiler throwing this warning: “missing initializer”? Isn’t the structure initialized?
- Returning a struct pointer
- How can I take a screenshot and save it as JPEG on Windows?
- Can printf get replaced by puts automatically in a C program?
- Is accessing the “value” of a linker script variable undefined behavior in C?
- Swift: How to call a C function loaded from a dylib