3      Copyright (C) Dean Camera, 2009. 
   5   dean [at] fourwalledcubicle [dot] com 
   6       www.fourwalledcubicle.com 
  10   Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com) 
  12   Permission to use, copy, modify, and distribute this software 
  13   and its documentation for any purpose and without fee is hereby 
  14   granted, provided that the above copyright notice appear in all 
  15   copies and that both that the copyright notice and this 
  16   permission notice and warranty disclaimer appear in supporting 
  17   documentation, and that the name of the author not be used in 
  18   advertising or publicity pertaining to distribution of the 
  19   software without specific, written prior permission. 
  21   The author disclaim all warranties with regard to this 
  22   software, including all implied warranties of merchantability 
  23   and fitness.  In no event shall the author be liable for any 
  24   special, indirect or consequential damages or any damages 
  25   whatsoever resulting from loss of use, data or profits, whether 
  26   in an action of contract, negligence or other tortious action, 
  27   arising out of or in connection with the use or performance of 
  33  *  This file contains macros for the embedding of compile-time strings into the resultant project binary for 
  34  *  identification purposes. It is designed to prefix "tags" with the magic string of "@(#)" so that the tags 
  35  *  can easily be identified in the binary data. 
  37  *  These tags are compatible with the ButtLoad project at http://www.fourwalledcubicle.com/ButtLoad.php . 
  40 #ifndef __BUTTLOADTAG_H__ 
  41 #define __BUTTLOADTAG_H__ 
  45                 #include <avr/pgmspace.h> 
  47         /* Public Interface - May be used in end-application: */ 
  49                         /** Creates a new tag in the resultant binary, containing the specified data array. The macro id 
  50                          *  parameter is only for identification purposes (so that the tag data can be referenced in code) 
  51                          *  and is not visible in the compiled binary. 
  53                         #define BUTTLOADTAG(id, data)  const struct ButtLoadTagData BUTTTAG_##id \ 
  54                                                        PROGMEM __attribute__((used, externally_visible)) = \ 
  55                                                        {MagicString: BT_TAGHEADER, TagData: data} 
  57                         /** Macro for retrieving a reference to the specified tag's contents. The tag data is located in 
  58                          *  the program memory (FLASH) space, and so must be read out with the macros in avr-libc which 
  59                          *  deal with embedded data. 
  61                         #define BUTTLOADTAG_DATA(id)  BUTTTAG_##id.TagData 
  64                         /** Structure for ButtLoad compatible binary tags. */ 
  65                         struct ButtLoadTagData
 
  67                                 char MagicString
[4]; /**< Magic tag header, containing the string "@(#)". */ 
  68                                 char TagData
[];      /**< Tag contents as a char array. */ 
  71         /* Private Interface - For use in library only: */       
  72         #if !defined(__DOXYGEN__) 
  74                         #define BT_TAGHEADER          {'@','(','#',')'}