MYSBootloader 1.1

Enhancements: static parent, bootloader commands, updated delay funtion
for more precise timing and minor improvements
This commit is contained in:
tekka
2015-03-14 13:46:24 +01:00
parent c83d8d62b3
commit 9b41d2a8e6
6 changed files with 1149 additions and 272 deletions
+14 -6
View File
@@ -5,6 +5,7 @@
#include <stdint.h>
#include <string.h>
#include <util/crc16.h>
#include <util/delay.h>
#include "MyMessage.h"
#include "MySensor.h"
@@ -13,11 +14,17 @@
#define FIRMWARE_BLOCK_SIZE 16
#define EEPROM_SIZE 1024 // 1024 bytes for ATMEGA328
// FW config structure, stored in eeprom
typedef struct {
uint16_t type;
uint16_t version;
union {
uint16_t type;
uint16_t bl_command;
};
union {
uint16_t version;
uint16_t bl_data
};
uint16_t blocks;
uint16_t crc;
} __attribute__((packed)) NodeFirmwareConfig;
@@ -48,9 +55,10 @@ static NodeFirmwareConfig fc;
static MyMessage outMsg;
static MyMessage inMsg;
#ifdef PRESCALE
static clock_div_t orgClockDiv = 0;
#endif
static boolean configuredParentFound = false;
static uint8_t configuredParentID = 0xFF;
//static clock_div_t orgClockDiv = 0;
static uint8_t progBuf[SPM_PAGESIZE];