From 7310eb2c9a43bcb926e87761b98f8def0a2fdb4f Mon Sep 17 00:00:00 2001 From: BlackMark Date: Fri, 15 May 2020 09:28:05 +0200 Subject: [PATCH] Remove bootloader support --- ds3231/bootloader.h | 56 ------------------------------------------- ds3231/ds3231.cppproj | 3 --- ds3231/main.cpp | 16 +------------ 3 files changed, 1 insertion(+), 74 deletions(-) delete mode 100644 ds3231/bootloader.h diff --git a/ds3231/bootloader.h b/ds3231/bootloader.h deleted file mode 100644 index a4516c7..0000000 --- a/ds3231/bootloader.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -* Copyright (c) by BlackMark 2016 -* Date 09/09/2016 -* Version 1.4 -*/ - -#ifndef BOOTLOADER_H -#define BOOTLOADER_H - -#include -#include -#include - -typedef void (*flash)() __attribute__ ((noreturn)); - -flash boot = reinterpret_cast( 0x0000 ); -flash bootloader = reinterpret_cast( 0x7E00 / 2 ); - -inline bool checkBootloader() -{ - if( pgm_read_byte( reinterpret_cast( bootloader ) * 2 ) == 0xF8 ) - { - return true; - } - - return false; -} - -inline void callBootloader() -{ - if( checkBootloader() ) - { - bootloader(); - } - else - { - boot(); - } -} - -inline uint8_t handleReset() -{ - wdt_reset(); - uint8_t ui8MCUSR = MCUSR; - MCUSR &= ~( 1 << WDRF ); - wdt_disable(); - return ui8MCUSR; -} - -inline void reset() -{ - wdt_enable( WDTO_15MS ); - while( true ); -} - -#endif \ No newline at end of file diff --git a/ds3231/ds3231.cppproj b/ds3231/ds3231.cppproj index fb76b02..f0119a0 100644 --- a/ds3231/ds3231.cppproj +++ b/ds3231/ds3231.cppproj @@ -215,9 +215,6 @@ - - compile - compile diff --git a/ds3231/main.cpp b/ds3231/main.cpp index 1d533dc..8dffe8e 100644 --- a/ds3231/main.cpp +++ b/ds3231/main.cpp @@ -13,7 +13,6 @@ #include "ds3231/systime.h" #include "clock.h" -#include "bootloader.h" void setup() { @@ -102,13 +101,6 @@ void setAlarm() int main() { - uint8_t ui8MCUSR = handleReset(); - - if( ui8MCUSR & ( 1 << WDRF ) ) - { - callBootloader(); - } - USART0 &cSerial = USART0::inst(); cSerial.init( 9600 ); @@ -142,13 +134,7 @@ int main() if( cSerial.receiveByte( ui8Cmd ) ) { - if( ui8Cmd == 'b' ) - { - cSerial << "Bootloader . . . " << "\r\n"; - _delay_ms( 1000 ); - reset(); - } - else if( ui8Cmd == 's' ) + if( ui8Cmd == 's' ) { setTime(); }