add new feature: "BOOTUP_CLEARRAM"
[pub/USBaspLoader.git] / firmware / bootloaderconfig.h
index 005d9bb..65b9cdb 100644 (file)
@@ -275,6 +275,29 @@ these macros are defined, the boot loader usees them.
  * instead the right content of the flash memory.
  */
 
+#ifdef CONFIG_USE__EXCESSIVE_ASSEMBLER
+#      define USE_EXCESSIVE_ASSEMBLER          1
+#else
+#      define USE_EXCESSIVE_ASSEMBLER          0
+#endif
+/* This macro enables large codeareas of hand-optimized assembler code.
+ * WARNING:
+ * It will only work properly on devices with <64k of flash memory and SRAM.
+ * Some configuration macros (when changed) may not be applied correctly
+ * (since their behaviour is raced within asm)!
+ * Nevertheless this feature saves lots of memory.
+ */
+
+#ifdef CONFIG_USE__BOOTUP_CLEARRAM
+#      define USE_BOOTUP_CLEARRAM              1
+#else
+#      define USE_BOOTUP_CLEARRAM              0
+#endif
+/* This macro enables some (init3) code, executed at bootup.
+ * This codefragment will safely overwrite the whole SRAM with "0"
+ * (except registers and IO), since RESET will NOT clear old RAM content.
+ */
+
 //#define SIGNATURE_BYTES             0x1e, 0x93, 0x07, 0     /* ATMega8 */
 /* This macro defines the signature bytes returned by the emulated USBasp to
  * the programmer software. They should match the actual device at least in
@@ -299,6 +322,10 @@ these macros are defined, the boot loader usees them.
 #   define MCUCSR   MCUSR
 #endif
 
+/* WARNING:
+ * following commands and macros may not be evaluated properly when 'USE_EXCESSIVE_ASSEMBLER"
+ */
+
 static inline void  bootLoaderInit(void)
 {
     PIN_DDR(JUMPER_PORT)  = 0;