From 354afe4506fa5e60df4c2f115bc1e021ce6ce89c Mon Sep 17 00:00:00 2001 From: Nico Bollen Date: Fri, 6 Jan 2023 11:02:36 +0100 Subject: [PATCH 1/2] allow to ignore leaving fill pattern bytes out of hex file --- include/intelhex.h | 2 +- src/intelhex.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/intelhex.h b/include/intelhex.h index 428a701..84d23b1 100644 --- a/include/intelhex.h +++ b/include/intelhex.h @@ -67,7 +67,7 @@ namespace intelhex value_type& operator[](address_type); //Array access operator value_type get(address_type); // Return the value at address - void set(address_type, value_type); // Set the value at address + void set(address_type, value_type, bool ignore_fill=false); // Set the value at address void load(const std::string&); // Load from a file void read(std::istream &); // Read data from an input stream diff --git a/src/intelhex.cc b/src/intelhex.cc index e7d01cb..6b34659 100644 --- a/src/intelhex.cc +++ b/src/intelhex.cc @@ -56,9 +56,9 @@ namespace intelhex } // Set the value at address or create a new element using value - void hex_data::set(address_type address, value_type value) + void hex_data::set(address_type address, value_type value, bool ignore_fill) { - if( value == fill() ) // Handle fill values + if( !ignore_fill && value == fill() ) // Handle fill values { erase(address); // If the address is already set, erase it return; From 8f074a42dc21620fe85882a2d1ea9ac978ae6b24 Mon Sep 17 00:00:00 2001 From: Nico Bollen Date: Mon, 13 Apr 2026 08:21:01 +0200 Subject: [PATCH 2/2] include what is used --- include/intelhex.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/intelhex.h b/include/intelhex.h index 84d23b1..714fc44 100644 --- a/include/intelhex.h +++ b/include/intelhex.h @@ -11,6 +11,7 @@ #include #include +#include namespace intelhex {