:: Home :: Code Snippets :: Drivers :: Projects :: About ::
 Main Menu
  Home
  Code Snippets
  About

 Open Drivers
 EA-DOGM - LCD Display Driver
 PIC32 mcompat - PIC32 mcompat
 qTask - Queued Task Manager
 _build - Embedded build information

 Open Projects
 fplCore - Self contained controller
 uProfiler - uController uProfiller
 oLogic - Oscilloscope Logic Viewer
 oLogic 1.4 - NEW Logic Viewer
 SSX32 - Serial Servo Driver



 Sources
Prototyping
  PicStuff
  Sparkfun

Equipment
  Saelig
  Tequipment

Supply House
  Jameco
  Mouser
  Digikey
  Allied Electronics
  Clearwater Technologies

Miscellaneous
  BCM
  N34D Blog

Build Hex filename, embedded version, and time stamp

I did this code because a client wanted to have the compile date in the .hex file names.

At the same time, I needed to have a time stamp embedded in the controller, so I knew what release was running.

Here is a solution for both!

In your code, if you read the string (stored in ROM) _build[], you will have the time and date of compile.

19 bytes of ROM are used to store the build date and time _build[] string format: "31-Aug-09 23:55:18"
 Driver Specs
mcu: PIC12,16,18
compiler: CCS C

 Files
ex1.h
_build.c

_build.zip - All files


Here is an example of using the driver with a single +5v source and any pins you want from a pic.
 Example Usage
// optional, these control the hex file name
#define _BUILD_PROJECT "Prj_Name"
#define _BUILD_VERSION "v1.0"

#include "_build.c"


And here is the complete source file.
 _build.c
/*
          file: _build.c
       project: standard include
   description: Use for tracking build date and time and setting
                the output hex file name
   written by : Michael Bradley

   Changelog:
            08/31/09 This module created


   USE:
      // optional, these control the hex file name
      #define _BUILD_PROJECT "Prj_Name"   
      #define _BUILD_VERSION "v1.0"

      #include "_build.c"
   
   REFERENCE:
   19 bytes of ROM are used to store the build date and time
   _build[] string format: "31-Aug-09 23:55:18"

*/


const char _build[19] = {__DATE__ " " __TIME__};

#ifdef _BUILD_PROJECT
   #define _BUILD_FILE _BUILD_PROJECT "-" _BUILD_VERSION "-" __DATE__ ".hex"
   #export (file=_BUILD_FILE, HEX)
#endif








:: Home :: Resources :: PIC Microcontrollers ::
:: 10F :: 12F :: 16F :: 18F :: 24F :: 24H :: 30F :: 33F ::
(C) Copyright 2009 mculabs.com - contact: info@mculabs.com
0.0028650760650635