This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Viewable in IE: Complaint on obscuring PSP programming style

Anonymous
Anonymous

Hi,

Controlling registers almost all 32-bits and each bit/bit group are clearly listed in documents with explanations. Why should example programs give it a pseudo-intuitive recast?

When I was studying http://www-s.ti.com/sc/techlit/spraap3.zip which accompanies SPRAAP3A, How to Use the VPBE and VPFE Driver on the TMS320DM643x Devices, I found the program is presented in an unnecessarily "advanced" wrapping style from which the actual intent and action are very very difficult to trace:

 

 

The ultimate goal of these assignments here are to modify register contents. However,

1.    No bit operation can be seen here, all are encapsulated by hardly necessary re-invented enum name constants

2.    Unrestrained use of elaborate structure, macro and manifold cross reference between files.

The tasks of these functions can be accomplished in a very straightforward way with simple register modifications, implemented using basic pointers. With proper comments, the code should be very readable. But what are these codes doing here? Is it championing for Jave, C# or MS.Net style programming on a embedded processor by practicing what it preaches? I only find it obscuring, misleading and hide what the actual action is, rather than affording any simplification.

I personally feel this style of programming is an awkward imitation of programming features which does not pertain to embedding programming at all. It is hard to read, hard to modify and is making simple things difficult and intimidating.

Does there exist a more straightforward version of the VPBE-LCD example, using in simple and clear modification commands? Could anyone help on this?

 

Zheng