O'Reilly logo

Embedded C Programming by Mark Siegesmund

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3

Preprocessor Directives

Abstract

This chapter explains how C programs are processed in two distinct steps. The preprocessor stage and the preprocessor directives are the focus of this chapter.

The ANSI required directives are each explained with examples of their use. This includes the very popular define used for textual replacements to improve both program readability and maintainability.

In addition this chapter covers compiler-specific directives required for programming embedded microcontrollers. Examples show setting processor configuration bits, oscillator types, and speed as well as accessing processor registers. Conditional compilation and macros are introduced; however, they are covered in detail on other chapters.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required