Radio Controlled Timer, Step F

Goal:

To determine if a time is matched. The current time in the RTC is compared to

  • the sunrise/sunset (per month)
  • the good morning /good night (for daylight saving or not)

If a match is found the function returns one of these events.

  • GOOD_MORNING
  • SUNRISE
  • SUNSET
  • GOOD_NIGHT

If no match found NOTHING is returned.

Source file “OnOff_1829_RadioControlledTimer” (.inc and .asm) created. (OK it is not the best name for the source file but …)

The definition of the events (GOOD_MORNING, …) are defined in the “OnOff_…inc file.

These definitions are also used in the “OnOff_…asm” file and I don’t want to duplicate the definitions.

To be able to include the “OnOff_…inc” file in the “OnOff_…asm” file the extern definition of “OnOff_Check” has to be excluded when include in the .asm file.

(Otherwise the assembler will see both

  • extern  OnOffCheck
  • global OnOffCheck

end get very confused.)

A “INCLUDED_IN_ASM” definition and an ifndef solves this.

To verify this, a unit test “OnOff_unittest_1829_RadioControlledTimer” (.inc and .asm) is used.

No schema change.

Code on Github.

Leave a Reply

Your email address will not be published. Required fields are marked *