Other Parts Discussed in Thread: MOTORWARE, CONTROLSUITE
In motorware source file drv_obj.h
typedef struct _DRV_Obj_
{
ADC_Handle adcHandle; //!< the ADC handle
CLK_Handle clkHandle; //!< the clock handle
...
} DRV_Obj;
and
typedef struct DRV_Obj *DRV_Handle;
Why the handle was not defined as
typedef DRV_Obj *DRV_Handle;
If this way, in function (and other functions)
DRV_init(void *pMemory,const size_t numBytes) { }
handle = (DRV_Handle)pMemory;
// assign the object
obj = (DRV_Obj *)handle;
obj would be the same as handle, therefore, unnecessarily repeated, one could use handle as the pointer in operations and return it as it is at the end of the function.
Please comment.
