2023-09-28 03:29 AM
Hello everyone!
I'm trying to debug a project based on the following video:
https://www.youtube.com/watch?v=PXfCyE-LnR4
As one of the steps, after adding the following text:
#define CCRValue_BufferSize 37
ALIGN_32BYTES (uint32_t DiscontinuousSineCCRValue_Buffer[CCRValue_BufferSize]) =
{
14999, 17603, 20128, 22498, 24640, 26488, 27988, 29093, 29770,
29998, 29770, 29093, 27988, 26488, 24640, 22498, 20128, 17603,
14999, 12394, 9869, 7499, 5357, 3509, 2009, 904, 227, 1, 227,
904, 2009, 3509, 5357, 7499, 9869, 12394, 14999
};
I get the error:
error: function 'ALIGN_32BYTES' is initialized like a variable
I would like to know how to solve the problem.
Thanks!
Solved! Go to Solution.
2023-09-28 05:57 AM
Unclear how ALIGN_32BYTES is defined. Perhaps it is missing or wrong.
In any case, you can use __attribute__((aligned(32))) to declare the array instead.
__attribute__((aligned(32))) uint32_t DiscontinuousSineCCRValue_Buffer[CCRValue_BufferSize] =
{
14999, 17603, 20128, 22498, 24640, 26488, 27988, 29093, 29770,
29998, 29770, 29093, 27988, 26488, 24640, 22498, 20128, 17603,
14999, 12394, 9869, 7499, 5357, 3509, 2009, 904, 227, 1, 227,
904, 2009, 3509, 5357, 7499, 9869, 12394, 14999
};
2023-09-28 05:57 AM
Unclear how ALIGN_32BYTES is defined. Perhaps it is missing or wrong.
In any case, you can use __attribute__((aligned(32))) to declare the array instead.
__attribute__((aligned(32))) uint32_t DiscontinuousSineCCRValue_Buffer[CCRValue_BufferSize] =
{
14999, 17603, 20128, 22498, 24640, 26488, 27988, 29093, 29770,
29998, 29770, 29093, 27988, 26488, 24640, 22498, 20128, 17603,
14999, 12394, 9869, 7499, 5357, 3509, 2009, 904, 227, 1, 227,
904, 2009, 3509, 5357, 7499, 9869, 12394, 14999
};