Machine-translated by Google. Questions are authored in English.
Top

Discussion

A driver is to be ported from one microcontroller family to another. The work is least if the driver was written

  • A.entirely in assembler for speed
  • B.with its state in file-scope statics
  • C.with the addresses of the registers published in its header file
  • D.against a hardware abstraction layer rather than raw registers

Answer: D

Correct answer: against a hardware abstraction layer rather than raw registers

Writing against an abstraction layer confines the device-specific detail to the layer, so porting means providing the layer for the new part rather than rewriting the driver. Assembler, published register addresses and file-scope statics all tie the code to one part in ways the port must undo.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.