carpenter.adrian

Why no user data?

Discussion created by carpenter.adrian on Feb 21, 2018
Latest reply on Feb 21, 2018 by carpenter.adrian

Did a search and can't find anything related to this, but why don't the peripheral structures like MMC_HandleTypeDef have a field for user data?

 

This would be really useful, for example I'm now abstracting some stuff in my software and I need to make use of the DMA callbacks in the MMC, but, I can't link my abstraction layer to the callback because I can't set any user data.

 

This means, I'm either going to have to have a global variable containing the pointer of abstraction or I'm going to have to create a reverse lookup which registers a peripheral with user data so that I can pass the peripheral pointer to a function and return the user data.

 

just adding a "void *userdata" to the structure would solve this, I'm sure this would be highly useful to many people who use RTOS and abstraction layers.

 

(I use C++)

Outcomes