RTC Clock Works UwU

main
MichaelK 1 month ago
parent e51aa3744e
commit cbeb16c4ee

@ -10,8 +10,8 @@
#define _DEBUG_ #define _DEBUG_
//Choose one //Choose one
//#define _SLAVE_MODULE_ #define _SLAVE_MODULE_
#define _SLAVE_EXT_ //#define _SLAVE_EXT_
//#define _CUSTOM_TYPE_ //#define _CUSTOM_TYPE_
//After this see idibus_hw.h to change PIN definition //After this see idibus_hw.h to change PIN definition

@ -22,10 +22,10 @@ extern "C" {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Status LED // Status LED
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#define RSLINK_LED_DDR DDRB #define RSLINK_LED_DDR DDRH
#define RSLINK_LED_PORT PORTB #define RSLINK_LED_PORT PORTH
#define RSLINK_LED_PIN PINB #define RSLINK_LED_PIN PINH
#define RSLINK_LED_BIT 0 #define RSLINK_LED_BIT 6
#ifdef _SLAVE_EXT_ #ifdef _SLAVE_EXT_
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

@ -7,7 +7,6 @@
#include <stdio.h> #include <stdio.h>
#include "IdiBusSlave.h" #include "IdiBusSlave.h"
#include "RSLink.h" #include "RSLink.h"
#include "IdiBusSlave.h"
#ifdef _NO_BOOTLOADER_ #ifdef _NO_BOOTLOADER_
FUSES= FUSES=
@ -25,7 +24,6 @@ extern void IdiBusSlaveInit(void);
int main(void) int main(void)
{ {
cli(); // INTR OFF cli(); // INTR OFF
// Enable wdt
wdt_enable(WDTO_2S); wdt_enable(WDTO_2S);
wdt_reset(); wdt_reset();
IdiBusSlaveInit(); // See idibus_custom.c file IdiBusSlaveInit(); // See idibus_custom.c file

@ -1,6 +1,10 @@
#include <stdio.h>
#include "IdiBusSlave.h" #include "IdiBusSlave.h"
#include "IDIBUS_IMPL.h" #include "IDIBUS_IMPL.h"
#include "Serial.h"
#include "DS3231.h"
#include "time.h"
//Structure that holds module's data //Structure that holds module's data
XXX_NAME_channel_data_t XXX_NAME_channels_data[IDIBUS_XXX_NAME_CH_NUM]; XXX_NAME_channel_data_t XXX_NAME_channels_data[IDIBUS_XXX_NAME_CH_NUM];
@ -20,20 +24,46 @@ static void custom_resume()
{ {
} }
void SlaveInit()//Intr is ON
void SlaveInit() // Intr is ON
{ {
//Hardware init
//...
//You can register custom c_Init or c_Shutdown here via IdiBus_register_xxx
IdiBus_register_init(custom_init); IdiBus_register_init(custom_init);
IdiBus_register_shutdown(custom_shutdown); IdiBus_register_shutdown(custom_shutdown);
IdiBus_register_freeze(custom_freeze); IdiBus_register_freeze(custom_freeze);
IdiBus_register_resume(custom_resume); IdiBus_register_resume(custom_resume);
Debug.begin(57600);
Debug.writeln("Program start");
initDS3231();
Debug.writeln("Clock RTC Init");
}
static int16_t temperature; // For whatever reason...
void updateTimeFromRtc()
{
static uint32_t timestamp_read = 0;
static const uint32_t PERIOD_MS = 1000;
if (System_GetSysTickDifference(timestamp_read) > PERIOD_MS)
{
temperature = ds3231GetTemperature();
char buf[64] = {0};
sprintf(buf, "Date %d:%d:%d - %d.%d.%d Temp:%i",
ds3231GetHour(), ds3231GetMinute(), ds3231GetSecond(),
ds3231GetDate(), ds3231GetMonth(), ds3231GetYear(),
temperature);
Debug.writeln(buf);
timestamp_read = System_GetSysTick();
}
} }
void SlaveLoop() void SlaveLoop()
{ {
//Read any data that can change in channels data //Read any data that can change in channels data
//... updateTimeFromRtc();
//Do some app logic //Do some app logic
//.. //..
//Update channel data //Update channel data

@ -1,10 +1,3 @@
# IdiBusSlaveTemplate # IdiBus_Logger
Общая заготовка для создания новых ведомых модулей. Модуль для счета реального времени и сохранения данных на SD карту
В состоянии тестирования.
### Поддерживаемые контроллеры:
1. ATMega328PB
2. ATMega1280
3. ATMega2560
Для корректной работы скрипта для подготовки прошивки имя папки и имя проекта должны совпадать

@ -0,0 +1,927 @@
#include "DS3231.h"
#include "i2cMaster.h"
static uint8_t decToBcd(uint8_t);
static uint8_t bcdToDec(uint8_t);
/*
sets up i2c bus and resets any necessary flags. MUST be called before using
the ds3231
*/
void initDS3231(void)
{
initI2C();
// clear any alarms
//ds3231RemoveAlarm(ALARM_1);
//ds3231RemoveAlarm(ALARM_2);
}
/*
utility function to set the register pointer on
the ds3231
Param: reg -> the register to be pointed at by the register pointer
Returns: DS3231_OPERATION_SUCCESS (0) on success
1 if the register provided was invalid
*/
uint8_t setRegisterPointer(uint8_t reg)
{
if(reg < DS3231_REGISTER_SECONDS || reg > DS3231_REGISTER_TEMPERATURE_LSB)
return 1;
i2cStart(DS3231_ADDRESS_WRITE);
i2cWrite(reg);
return DS3231_OPERATION_SUCCESS;
}
/*
utility function to get a registers value (single byte)
Param: reg -> the register to read
Returns: the value of the register (1 byte)
*/
uint8_t getRegisterValue(uint8_t reg)
{
setRegisterPointer(reg);
i2cRepeatStart(DS3231_ADDRESS_READ);
uint8_t registerValue = i2cReadNak();
i2cStop();
return registerValue;
}
/*
writes the value to the provided register of the
ds3231
Param: value -> the value to write to the register
reg -> the register to write the value to
Returns: DS3231_OPERATION_SUCCESS (0) on success
1 if the register provided was out of range
*/
uint8_t writeValueThenStop(uint8_t value, uint8_t reg)
{
if(reg < DS3231_REGISTER_SECONDS || reg > DS3231_REGISTER_TEMPERATURE_LSB)
return 1;
setRegisterPointer(reg);
i2cWrite(value);
i2cStop();
return DS3231_OPERATION_SUCCESS;
}
/*
allows for alarms to be cleared/removed/deleted from the ds3231. This function clears
the appropriate alarms registers, clears the alarm flag and clears the alarm enable bit.
Removing an alarm permantely deletes the alarm, unlike the `ds3231ClearAlarmFlag` function
which just clears the alarm triggered flag but keeps the alarm
Param: alarm -> the alarm number to clear, e.g. ALARM_2
Returns: DS3231_OPERATION_SUCCESS (0) if everything was ok
1 if an invalid alarm number was provided
*/
uint8_t ds3231RemoveAlarm(alarm_number_t alarm)
{
if(alarm < 0 || alarm >= ALARM_NUMBER_T_MAX)
return 1;
// assume alarm 1, if alarm 2 this data gets changed
uint8_t minutesReg = DS3231_REGISTER_ALARM1_MINUTES;
uint8_t hoursReg = DS3231_REGISTER_ALARM1_HOURS;
uint8_t dayDateReg = DS3231_REGISTER_ALARM1_DAY_DATE;
uint8_t enableInterruptFlag = DS3231_CONTROL_A1IE_BIT;
uint8_t alarmFlag = DS3231_STATUS_A1F_BIT;
if(alarm == ALARM_2)
{
minutesReg = DS3231_REGISTER_ALARM2_MINUTES;
hoursReg = DS3231_REGISTER_ALARM2_HOURS;
dayDateReg = DS3231_REGISTER_ALARM2_DAY_DATE;
enableInterruptFlag = DS3231_CONTROL_A2IE_BIT;
alarmFlag = DS3231_STATUS_A2F_BIT;
}
if(alarm == ALARM_1) // only alarm1 has seconds register
writeValueThenStop(0, DS3231_REGISTER_ALARM1_SECONDS);
// clear mins, hours and day/date alarm registers
writeValueThenStop(0, minutesReg);
writeValueThenStop(0, hoursReg);
writeValueThenStop(0, dayDateReg);
// disable interrupts for alarm
uint8_t controlReg = getRegisterValue(DS3231_REGISTER_CONTROL);
writeValueThenStop(controlReg & ~enableInterruptFlag, DS3231_REGISTER_CONTROL);
// clear alarm flag
uint8_t statusReg = getRegisterValue(DS3231_REGISTER_STATUS);
writeValueThenStop(statusReg & ~alarmFlag, DS3231_REGISTER_STATUS);
return DS3231_OPERATION_SUCCESS;
}
/*
sets the global hour mode for the ds3231. The ds3231 offers 2 modes
for storing the hours value in the timekeeping registers and alarm registers,
these are AM/PM mode (uses 12 hours and a AM/PM indicator bit) and 24 hour mode.
This should be called before any other if needing to change the mode to AM/PM, as
24 hour mode is selected by default
*/
void ds3231Use12HourMode(bool use12HourMode)
{
is24HourMode = !use12HourMode;
}
/*
ensures the alarm_t struct passed to set an alarm contains valid combinations of values
Param: alarm -> pointer to the alarm the user supplied to be passed to the ds3231
Returns: DS3231_OPERATION_SUCCESS (0) if the alarm was valid
1 if an invalid alarmNumber was used
2 if an invalid trigger was used
3 if an invalid second value was used with ALARM1 and A1_SEC_MATCH
4 if an invalid second or minute value was used with ALARM1 and A1_MIN_SEC_MATCH
5 if an invalid second or minute or hour value was used with ALARM1 and A1_HOUR_MIN_SEC_MATCH
6 if an invalid second or minute or hour or day/date value was used with ALARM1 and A1_DAY_DATE_HOUR_MIN_SEC_MATCH
7 if an invalid minute was used with ALARM2 and A2_MIN_MATCH
8 if an invalid minute or hour was used with ALARM2 and A2_HOUR_MIN_MATCH
9 if an invalid minute or hour or day/date was used with ALARM2 and A2_DAY_DATE_HOUR_MIN_MATCH
10 unknown error occurred processing alarm 1
11 unknown error occurred processing alarm 2
12 unknown error occurred after handling alarm 1 or 2
*/
static uint8_t validateAlarm(const alarm_t *alarm)
{
// invalid alarm number
if(alarm->alarmNumber < 0 || alarm->alarmNumber >= ALARM_NUMBER_T_MAX)
return 1;
// invalid trigger
if(alarm->trigger < 0 || alarm->trigger >= ALARM_TRIGGER_T_MAX)
return 2;
if(alarm->alarmNumber == ALARM_1)
{
switch(alarm->trigger)
{
case A1_EVERY_SEC: // no values are needed in this case
return DS3231_OPERATION_SUCCESS;
case A1_SEC_MATCH:
if(alarm->second < 60)
return DS3231_OPERATION_SUCCESS;
return 3;
case A1_MIN_SEC_MATCH:
if(alarm->second < 60 && alarm->minute < 60)
return DS3231_OPERATION_SUCCESS;
return 4;
case A1_HOUR_MIN_SEC_MATCH:
if(alarm->second < 60 && alarm->minute < 60)
if((is24HourMode && alarm->hour < 24) || (!is24HourMode && alarm->hour < 13))
return DS3231_OPERATION_SUCCESS;
return 5;
case A1_DAY_DATE_HOUR_MIN_SEC_MATCH:
if(alarm->second < 60 && alarm->minute < 60)
{
if((is24HourMode && alarm->hour < 24) || (!is24HourMode && alarm->hour < 13))
{
if(alarm->useDay && (alarm->dayDate > 0 && alarm->dayDate < DAY_T_MAX))
{
return DS3231_OPERATION_SUCCESS;
}
else if(!alarm->useDay && (alarm->dayDate < 32))
{
return DS3231_OPERATION_SUCCESS;
}
}
}
return 6;
default:
return 10;
}
}
else // check alarm 2 combinations
{
switch(alarm->trigger)
{
case A2_EVERY_MIN: // no values needed in this case
return DS3231_OPERATION_SUCCESS;
case A2_MIN_MATCH:
if(alarm->minute < 60)
return DS3231_OPERATION_SUCCESS;
return 7;
case A2_HOUR_MIN_MATCH:
if(alarm->minute < 60)
if((is24HourMode && alarm->hour < 24) || (!is24HourMode && alarm->hour < 13))
return DS3231_OPERATION_SUCCESS;
return 8;
case A2_DAY_DATE_HOUR_MIN_MATCH:
if(alarm->minute < 60)
{
if((is24HourMode && alarm->hour < 24) || (!is24HourMode && alarm->hour < 13))
{
if(alarm->useDay && (alarm->dayDate > 0 && alarm->dayDate < DAY_T_MAX))
{
return DS3231_OPERATION_SUCCESS;
}
else if(!alarm->useDay && (alarm->dayDate < 32))
{
return DS3231_OPERATION_SUCCESS;
}
}
}
return 9;
default:
return 11;
}
}
return 12;
}
/*
sets an alarm on the ds3231. Also ensures INTCN and A1IE / A2IE is set so alarms will function
Param: alarm -> pointer to the alarm struct that contains all the info needed to
set the alarm
Returns: DS3231_OPERATION_SUCCESS (0) if the alarm was valid
1 if an invalid alarmNumber was used
2 if an invalid trigger was used
3 if an invalid second value was used with ALARM1 and A1_SEC_MATCH
4 if an invalid second or minute value was used with ALARM1 and A1_MIN_SEC_MATCH
5 if an invalid second or minute or hour value was used with ALARM1 and A1_HOUR_MIN_SEC_MATCH
6 if an invalid second or minute or hour or day/date value was used with ALARM1 and A1_DAY_DATE_HOUR_MIN_SEC_MATCH
7 if an invalid minute was used with ALARM2 and A2_MIN_MATCH
8 if an invalid minute or hour was used with ALARM2 and A2_HOUR_MIN_MATCH
9 if an invalid minute or hour or day/date was used with ALARM2 and A2_DAY_DATE_HOUR_MIN_MATCH
10 unknown error occurred processing alarm 1
11 unknown error occurred processing alarm 2
12 unknown error occurred after handling alarm 1 or 2
*/
uint8_t ds3231SetAlarm(const alarm_t *alarm)
{
uint8_t error = validateAlarm(alarm);
if(error)
return error;
// enable alarm interrupts
uint8_t controlReg = getRegisterValue(DS3231_REGISTER_CONTROL);
// ensure INTCN is set for alarms to trigger an interrupt on INTCN/SQW pin
// ensure A1IE / A2IE is enabled for alarm1/2 interrupts
controlReg |= DS3231_CONTROL_INTCN_BIT;
if(alarm->alarmNumber == ALARM_1)
controlReg |= DS3231_CONTROL_A1IE_BIT;
else
controlReg |= DS3231_CONTROL_A2IE_BIT;
writeValueThenStop(controlReg, DS3231_REGISTER_CONTROL);
if(alarm->alarmNumber == ALARM_1)
{
switch(alarm->trigger)
{
case A1_EVERY_SEC: // needs a1m1, a1m2, a1m3 and a1m4 all set
// set a1m1
writeValueThenStop(decToBcd(DS3231_ALARM1_A1M1_BIT), DS3231_REGISTER_ALARM1_SECONDS);
// set a1m2
writeValueThenStop(decToBcd(DS3231_ALARM1_A1M2_BIT), DS3231_REGISTER_ALARM1_MINUTES);
// set a1m3
writeValueThenStop(decToBcd(DS3231_ALARM1_A1M3_BIT), DS3231_REGISTER_ALARM1_HOURS);
// set a1m4
writeValueThenStop(decToBcd(DS3231_ALARM1_A1M4_BIT), DS3231_REGISTER_ALARM1_DAY_DATE);
break;
case A1_SEC_MATCH: // needs a1m2, a1m3 and a1m4 set
// set seconds
writeValueThenStop(decToBcd(alarm->second), DS3231_REGISTER_ALARM1_SECONDS);
// set a1m2
writeValueThenStop(decToBcd(DS3231_ALARM1_A1M2_BIT), DS3231_REGISTER_ALARM1_MINUTES);
// set a1m3
writeValueThenStop(decToBcd(DS3231_ALARM1_A1M3_BIT), DS3231_REGISTER_ALARM1_HOURS);
// set a1m4
writeValueThenStop(decToBcd(DS3231_ALARM1_A1M4_BIT), DS3231_REGISTER_ALARM1_DAY_DATE);
break;
case A1_MIN_SEC_MATCH: // needs a1m3 and a1m4 set
// set seconds
writeValueThenStop(decToBcd(alarm->second), DS3231_REGISTER_ALARM1_SECONDS);
// set mins
writeValueThenStop(decToBcd(alarm->minute), DS3231_REGISTER_ALARM1_MINUTES);
// set a1m3
writeValueThenStop(decToBcd(DS3231_ALARM1_A1M3_BIT), DS3231_REGISTER_ALARM1_HOURS);
// set a1m4
writeValueThenStop(decToBcd(DS3231_ALARM1_A1M4_BIT), DS3231_REGISTER_ALARM1_DAY_DATE);
break;
case A1_HOUR_MIN_SEC_MATCH: // needs a1m4 set
// set seconds
writeValueThenStop(decToBcd(alarm->second), DS3231_REGISTER_ALARM1_SECONDS);
// set mins
writeValueThenStop(decToBcd(alarm->minute), DS3231_REGISTER_ALARM1_MINUTES);
// set hours
writeValueThenStop(decToBcd(alarm->hour), DS3231_REGISTER_ALARM1_HOURS);
// set a1m4
writeValueThenStop(decToBcd(DS3231_ALARM1_A1M4_BIT), DS3231_REGISTER_ALARM1_DAY_DATE);
break;
case A1_DAY_DATE_HOUR_MIN_SEC_MATCH: // no a1m* bits needed
// set seconds
writeValueThenStop(decToBcd(alarm->second), DS3231_REGISTER_ALARM1_SECONDS);
// set mins
writeValueThenStop(decToBcd(alarm->minute), DS3231_REGISTER_ALARM1_MINUTES);
// set hours
writeValueThenStop(decToBcd(alarm->hour), DS3231_REGISTER_ALARM1_HOURS);
// set day/date
if(alarm->useDay)
writeValueThenStop(alarm->dayDate | DS3231_ALARM_DAY_BIT, DS3231_REGISTER_ALARM1_DAY_DATE);
else
writeValueThenStop(decToBcd(alarm->dayDate), DS3231_REGISTER_ALARM1_DAY_DATE);
break;
default: // this should never be reached, here to stop compiler warnings
break;
}
}
else // alarm 2
{
switch(alarm->trigger)
{
case A2_EVERY_MIN: // needs a2m2, a2m3 and a2m4 set
// set a2m2
writeValueThenStop(decToBcd(DS3231_ALARM2_A2M2_BIT), DS3231_REGISTER_ALARM2_MINUTES);
// set a2m3
writeValueThenStop(decToBcd(DS3231_ALARM2_A2M3_BIT), DS3231_REGISTER_ALARM2_HOURS);
// set a2m4
writeValueThenStop(decToBcd(DS3231_ALARM2_A2M4_BIT), DS3231_REGISTER_ALARM2_DAY_DATE);
break;
case A2_MIN_MATCH: // a2m3 and a2m4 set
// set a2m3
writeValueThenStop(decToBcd(DS3231_ALARM2_A2M3_BIT), DS3231_REGISTER_ALARM2_HOURS);
// set a2m4
writeValueThenStop(decToBcd(DS3231_ALARM2_A2M4_BIT), DS3231_REGISTER_ALARM2_DAY_DATE);
// set minutes
writeValueThenStop(decToBcd(alarm->minute), DS3231_REGISTER_ALARM2_MINUTES);
break;
case A2_HOUR_MIN_MATCH: // a2m4 set
// set a2m4
writeValueThenStop(decToBcd(DS3231_ALARM2_A2M4_BIT), DS3231_REGISTER_ALARM2_DAY_DATE);
// set minutes
writeValueThenStop(decToBcd(alarm->minute), DS3231_REGISTER_ALARM2_MINUTES);
// set hours
writeValueThenStop(decToBcd(alarm->hour), DS3231_REGISTER_ALARM2_HOURS);
break;
case A2_DAY_DATE_HOUR_MIN_MATCH: // no a2m* bits needed, does need day/date bit set
// set minutes
writeValueThenStop(decToBcd(alarm->minute), DS3231_REGISTER_ALARM2_MINUTES);
// set hours
writeValueThenStop(decToBcd(alarm->hour), DS3231_REGISTER_ALARM2_HOURS);
if(alarm->useDay)
writeValueThenStop(alarm->dayDate | DS3231_ALARM_DAY_BIT, DS3231_REGISTER_ALARM2_DAY_DATE);
else
writeValueThenStop(decToBcd(alarm->dayDate), DS3231_REGISTER_ALARM2_DAY_DATE);
break;
default: // this should never be reached, here to stop compiler warnings
break;
}
}
ds3231ClearAlarmFlag(alarm->alarmNumber);
return DS3231_OPERATION_SUCCESS;
}
/*
used to reset an alarms flag (that indicates the alarm was triggered). This function does
NOT delete the alarm, to delete an alarm see the `ds3231RemoveAlarm` function
Param: alarm -> the alarm number flag to be reset, e.g. ALARM_1
Returns: DS3231_OPERATION_SUCCESS (0)
*/
uint8_t ds3231ClearAlarmFlag(alarm_number_t alarm)
{
uint8_t statusReg = getRegisterValue(DS3231_REGISTER_STATUS);
if(alarm == ALARM_1)
writeValueThenStop(statusReg & ~DS3231_STATUS_A1F_BIT, DS3231_REGISTER_STATUS);
else
writeValueThenStop(statusReg & ~DS3231_STATUS_A2F_BIT, DS3231_REGISTER_STATUS);
return DS3231_OPERATION_SUCCESS;
}
/*
convenience function to set the ds3231 time using a single function
Param: hour -> the hour to set the ds3231 to
minute -> the minute to set the ds3231 to
second -> the second to set the ds3231 to
isPM -> used to indicate whether the hours value should be treated as a PM value
this should only be true if 12 hour AM/PM mode is activated and it is a PM value.
By default 12 hour AM/PM mode is NOT enabled
*/
uint8_t ds3231SetTime(uint8_t hour, uint8_t minute, uint8_t second, bool isPM)
{
uint8_t error = DS3231_OPERATION_SUCCESS;
error |= ds3231SetHour(hour, isPM);
error |= ds3231SetMinute(minute);
error |= ds3231SetSecond(second);
return error == DS3231_OPERATION_SUCCESS ? DS3231_OPERATION_SUCCESS : error;
}
/*
allows the day, date, month, year and century to be set with a single function call
Param: day -> the desired day the DS3231 will be set to
date -> the desired date the DS3231 will be set to
month -> the desired month the DS3231 will be set to
year -> the desired year the DS3231 will be set to
century -> the desired century the DS3231 will be set to
Returns: DS3231_OPERATION_SUCCESS (0) if everything worked, otherwise a non-zero error
*/
uint8_t ds3231SetFullDate(day_t day, uint8_t date, month_t month, uint8_t year, uint8_t century)
{
uint8_t error = DS3231_OPERATION_SUCCESS;
error |= ds3231SetDay(day);
error |= ds3231SetDate(date);
error |= ds3231SetMonth(month);
error |= ds3231SetYear(year);
ds3231SetCentury(century);
return error == DS3231_OPERATION_SUCCESS ? DS3231_OPERATION_SUCCESS : error;
}
/*
checks to see if the CENTURY_BIT bit is set in the MONTH register. If it is then a new century has been entered so the currentCentury counter is incremented.
This function should be called at the start / end of every other function that interacts with the DS3231, otherwise turning a century will be missed. However if it is unlikely that the DS3231 will experience a change in century, this function can be ignored and removed from the rest of the library code
*/
static void checkCentury(void)
{
uint8_t month = getRegisterValue(DS3231_REGISTER_MONTH_CENTURY);
if(month & DS3231_CENTURY_BIT) // entered a new century
{
century++;
month &= ~(DS3231_CENTURY_BIT); // this forces the century bit clear whilst keeping the correct month
ds3231SetMonth((month_t) month);
}
}
/*
Returns: the current century of the DS3231, e.g.
21 = 20xx, 22 = 21xx etc.
*/
uint8_t ds3231GetCentury(void)
{
checkCentury();
return century;
}
/*
Sets the starting century for the DS3231. The DS3231 doesn't store the century
itself, so the library handles it
*/
void ds3231SetCentury(uint8_t cent)
{
century = cent;
}
/*
allows the year to be set on the ds3231
Param: the year to set on the ds3231
Returns: DS3231_OPERATION_SUCCESS (0) on success
1 if the year is invalid (> 99)
*/
uint8_t ds3231SetYear(uint8_t year)
{
if(year > 99)
return 1;
checkCentury();
writeValueThenStop(decToBcd(year), DS3231_REGISTER_YEAR);
return DS3231_OPERATION_SUCCESS;
}
/*
allows the retreival of the year held by the ds3231
Returns: the year held by the ds3231
*/
uint8_t ds3231GetYear(void)
{
checkCentury();
uint8_t year = getRegisterValue(DS3231_REGISTER_YEAR);
return bcdToDec(year);
}
/*
sets the month on the ds3231
Param: month -> the month to set the ds3231 to
Returns: DS3231_OPERATION_SUCCESS (0) on success
1 if the month provided was out of range
*/
uint8_t ds3231SetMonth(month_t month)
{
if(month < 0 || month >= MONTH_T_MAX)
return 1;
writeValueThenStop(decToBcd((uint8_t) month), DS3231_REGISTER_MONTH_CENTURY);
return DS3231_OPERATION_SUCCESS;
}
/*
allows the retreival of the current date held by the ds3231
Returns: the month held by the ds3231
*/
month_t ds3231GetMonth(void)
{
checkCentury();
uint8_t month = getRegisterValue(DS3231_REGISTER_MONTH_CENTURY);
return (month_t) bcdToDec(month);
}
/*
allows the date to be set on the ds3231
Param: date -> the date to set the ds3231 to
Returns: DS3231_OPERATION_SUCCESS (0) on success
1 if the date provided was out of range (> 31)
*/
uint8_t ds3231SetDate(uint8_t date)
{
if(date > 31)
return 1;
checkCentury();
writeValueThenStop(decToBcd(date), DS3231_REGISTER_DATE);
return DS3231_OPERATION_SUCCESS;
}
/*
allows the date to be retreived from the ds3231
Returns: the date held by the ds3231
*/
uint8_t ds3231GetDate(void)
{
checkCentury();
uint8_t date = getRegisterValue(DS3231_REGISTER_DATE);
return bcdToDec(date);
}
/*
allows the day value to be set for the ds3231
Param: day -> the day to set the ds3231 to
Returns: DS3231_OPERATION_SUCCESS (0) on success
1 if the day provided was invalid
*/
uint8_t ds3231SetDay(day_t day)
{
if(day < 0 || day >= DAY_T_MAX)
return 1;
checkCentury();
writeValueThenStop(decToBcd((uint8_t) day), DS3231_REGISTER_DAY);
return DS3231_OPERATION_SUCCESS;
}
/*
allows the ds3231 day value to be retreived
Returns: the current day value of the ds3231
*/
day_t ds3231GetDay(void)
{
checkCentury();
uint8_t day = getRegisterValue(DS3231_REGISTER_DAY);
return (day_t) bcdToDec(day);
}
/*
sets the hours register on the ds3231
Param: hours -> the hours value to set the ds3231 to
isPM -> if using 12 hour mode isPM states whether the hours value
represents a PM time (if true) or AM time (if false).
isPM is ignored if 24 hour mode is being used
Return: DS3231_OPERATION_SUCCESS (0) if setting the hours worked
1 if an invalid hours value was supplied for 24 hour mode
2 if an invalid hours value was supplied for 12 hour mode
*/
uint8_t ds3231SetHour(uint8_t hours, bool isPM)
{
if(is24HourMode && hours > 23)
return 1;
if(!is24HourMode && hours > 12)
return 2;
checkCentury();
uint8_t hoursValue = 0; // used to build the byte to send
if(!is24HourMode) // set special bits for 12 hr mode
{
hoursValue |= DS3231_HOUR_MODE_12_BIT; // bit 6 indicates the mode
if(isPM)
hoursValue |= DS3231_PM_BIT;
}
hoursValue |= decToBcd(hours);
writeValueThenStop(hoursValue, DS3231_REGISTER_HOURS);
return DS3231_OPERATION_SUCCESS;
}
/*
allows the ds3231 hour value to be retreived
Returns: the hours value the ds3231 has currently stored
*/
uint8_t ds3231GetHour(void)
{
checkCentury();
uint8_t hours = getRegisterValue(DS3231_REGISTER_HOURS);
return bcdToDec(hours);
}
/*
allows the minutes value of the ds3231 to be set
Param: minutes -> the minutes value to set on the ds3231
Returns: DS3231_OPERATION_SUCCESS (0) on success
1 if the minutes value was invalid (> 59)
*/
uint8_t ds3231SetMinute(uint8_t minutes)
{
if(minutes > 59) // invalid condition
return 1;
checkCentury();
writeValueThenStop(decToBcd(minutes), DS3231_REGISTER_MINUTES);
return DS3231_OPERATION_SUCCESS;
}
/*
allows the minutes value of the ds3231 to be returned
Returns: the minutes value held by the ds3231
*/
uint8_t ds3231GetMinute(void)
{
checkCentury();
uint8_t minutes = getRegisterValue(DS3231_REGISTER_MINUTES);
return bcdToDec(minutes);
}
/*
allows the seconds value of the ds3231 to be set
Param: seconds -> the seconds value to pass to the ds3231
Returns: DS3231_OPERATION_SUCCESS (0) on success
1 if the seconds value was invalid (> 59)
*/
uint8_t ds3231SetSecond(uint8_t seconds)
{
if(seconds > 59)
return 1; // invalid condition
checkCentury();
writeValueThenStop(decToBcd(seconds), DS3231_REGISTER_SECONDS);
return DS3231_OPERATION_SUCCESS;
}
/*
allows the seconds value of the ds3231 to be retreived
Returns: the seconds value the ds3231 is at currently
*/
uint8_t ds3231GetSecond(void)
{
checkCentury();
uint8_t seconds = getRegisterValue(DS3231_REGISTER_SECONDS);
return bcdToDec(seconds);
}
/*
sets the oscillator enable bit in the control register to 1, which indicates that when the
ds3231 switches to the battery power supply that the oscillator should stop (therefore
saving the power). This does mean however that no new data is put into the time registers,
essentially disables the time functions of the ds3231
Returns: DS3231_OPERATION_SUCCESS (0)
*/
uint8_t ds3231DisableOscillatorOnBattery(void)
{
uint8_t controlReg = getRegisterValue(DS3231_REGISTER_CONTROL);
writeValueThenStop(controlReg | DS3231_CONTROL_EOSC_BIT, DS3231_REGISTER_CONTROL);
return DS3231_OPERATION_SUCCESS;
}
/*
enables the oscillator to run when the ds3231 switches to battery mode. By default this is already the case and therefore there is no need to call this function if "ds3231DisableOscillatorOnBattery(void)" has not been called
Returns: DS3231_OPERATION_SUCCESS (0)
*/
uint8_t ds3231EnableOscillatorOnBattery(void)
{
uint8_t controlReg = getRegisterValue(DS3231_REGISTER_CONTROL);
writeValueThenStop(controlReg & ~DS3231_CONTROL_EOSC_BIT, DS3231_REGISTER_CONTROL);
return DS3231_OPERATION_SUCCESS;
}
/*
enables the battery backed square wave output. Enabling this clears the INTCN bit and
therefore means alarms will not trigger
Returns: DS3231_OPERATION_SUCCESS (0) if everything was ok
1 if an invalid frequency was provided
*/
uint8_t ds3231EnableBBSQW(bbsqw_frequency_t freq)
{
uint8_t controlReg = getRegisterValue(DS3231_REGISTER_CONTROL);
controlReg &= ~(DS3231_CONTROL_INTCN_BIT); // clear intc otherwise bbsqw will not work
controlReg |= DS3231_CONTROL_BBQSW_BIT;
switch(freq)
{
case HZ_1: // rs1 and rs2 both clear
controlReg &= ~(DS3231_CONTROL_RS1_BIT);
controlReg &= ~(DS3231_CONTROL_RS2_BIT);
break;
case KHZ_1_024: // rs1 set, rs2 clear
controlReg |= DS3231_CONTROL_RS1_BIT;
controlReg &= ~(DS3231_CONTROL_RS2_BIT);
break;
case KHZ_4_096: // rs1 clear, rs2 set
controlReg |= DS3231_CONTROL_RS2_BIT;
controlReg &= ~(DS3231_CONTROL_RS1_BIT);
break;
case KHZ_8_192: // rs1 and rs2 set
controlReg |= (DS3231_CONTROL_RS1_BIT | DS3231_CONTROL_RS2_BIT);
break;
default:
i2cStop();
return 1;
}
writeValueThenStop(controlReg, DS3231_REGISTER_CONTROL);
return DS3231_OPERATION_SUCCESS;
}
/*
the ds3231 updates the temperature values every 64 seconds, however a user can force
a new temperature reading by setting the CONV bit in the CONTROL register
*/
void ds3231ForceTemperatureUpdate(void)
{
bool busy = true;
do // loop until BSY is clear (we can start our conversion)
{
uint8_t statusReg = getRegisterValue(DS3231_REGISTER_STATUS);
if(!(statusReg & DS3231_STATUS_BSY_BIT))
busy = false;
} while(busy);
// set the CONV bit to start a new conversion
uint8_t controlReg = getRegisterValue(DS3231_REGISTER_CONTROL);
writeValueThenStop(controlReg | DS3231_CONTROL_CONV_BIT, DS3231_REGISTER_CONTROL);
busy = true;
do // loop until CONV becomes clear (conversion complete)
{
uint8_t controlReg = getRegisterValue(DS3231_REGISTER_CONTROL);
if(!(controlReg & DS3231_CONTROL_CONV_BIT))
busy = false;
} while(busy);
}
/*
reads the temperature sensor of the ds3231. The temperature is encoded in a uint16_t with
bits 15 to 8 (0 indexed) representing a SIGNED integer temperature and bits 7 to 6
representing the decimal part of the temperature. For example, if the function
returned...
6464 which is 0001100101000000
Then the top 8 bits (00011001) are the SIGNED integer representation of the temperature,
which is +25
And the following 2 bits (01) are the fractional part of the temperature, which is 0.25
So the tempreature read was +25.25
NOTE: the ds3231 has a valid temperature reading at around 2 seconds after first powering on,
reading the temperature before this will likely lead to an incorrect result
Returns: encoded 10 bit temperature value
*/
static int16_t ds3231_raw_to_temperature(uint8_t temp_msb, uint8_t temp_lsb) {
// ????????? ????? ????? ?? ?????? (??????? ????)
// ???????? ????? ?? 8 ???, ????? ???????? 16-?????? ?????
int16_t raw = (int16_t)((temp_msb << 8) | temp_lsb);
// ???????? ?????? ?? 6 ??? (??????? ??????? ??????? ????)
// ? ???????? ?? 25, ????? ???????? ????? ???? ???????
// (0.25°C * 100 = 25)
return (raw >> 6) * 25;
}
int16_t ds3231GetTemperature(void)
{
uint8_t temperatureUpper = getRegisterValue(DS3231_REGISTER_TEMPERATURE_MSB);
uint8_t temperatureLower = getRegisterValue(DS3231_REGISTER_TEMPERATURE_LSB);
return ds3231_raw_to_temperature(temperatureUpper, temperatureLower);
}
/*
checks if the OSCILLATOR STOPPED FLAG (OSF) is set, if so the oscillator was stopped at some point, therefore the validity of the data held in the ds3231's registers may be at risk.
Also, clears the OSF flag if it was set
Returns: true if the oscillator has stopped at some point, false if it hasn't
*/
bool ds3231HasOscillatorStopped(void)
{
uint8_t statusReg = getRegisterValue(DS3231_REGISTER_STATUS);
bool didStop = false;
if(statusReg & DS3231_STATUS_OSF_BIT) // oscillator stopped flag set
{
didStop = true;
// now reset the flag
writeValueThenStop(statusReg & ~DS3231_STATUS_OSF_BIT, DS3231_REGISTER_STATUS);
}
return didStop;
}
/*
enables the 32KHz square wave output signal. The oscillator must be running for this
wave to be output
Returns: DS3231_OPERATION_SUCCESS (0)
*/
uint8_t ds3231Enable32KHzOutput(void)
{
uint8_t statusReg = getRegisterValue(DS3231_REGISTER_STATUS);
if(statusReg & ~DS3231_STATUS_EN32KHZ_BIT) // wasn't enabled, so enable it
writeValueThenStop(statusReg | DS3231_STATUS_EN32KHZ_BIT, DS3231_REGISTER_STATUS);
return DS3231_OPERATION_SUCCESS;
}
/*
disables the 32KHz square wave output signal
Returns: DS3231_OPERATION_SUCCESS (0)
*/
uint8_t ds3231Disable32KhzOutput(void)
{
uint8_t statusReg = getRegisterValue(DS3231_REGISTER_STATUS);
if(statusReg & DS3231_STATUS_EN32KHZ_BIT) // is enabled, so disable it
writeValueThenStop(statusReg & ~DS3231_STATUS_EN32KHZ_BIT, DS3231_REGISTER_STATUS);
return DS3231_OPERATION_SUCCESS;
}
/*
allows the aging offset register value to be set
Param: offset -> the value to set the aging offset register to
Returns: DS3231_OPERATION_SUCCESS (0)
*/
uint8_t ds3231SetAgingOffset(int8_t offset)
{
writeValueThenStop(offset, DS3231_REGISTER_AGING_OFFSET);
return DS3231_OPERATION_SUCCESS;
}
/*
allows the aging offset register to be read
Returns: the signed value stored in the aging offset register
*/
int8_t ds3231GetAgingOffset(void)
{
return getRegisterValue(DS3231_REGISTER_AGING_OFFSET);
}
/*
used to convert normal decimal numbers to BCD numbers
Param: val -> the decimal value
Returns: the BCD representation of val
*/
static uint8_t decToBcd(uint8_t val)
{
return (val / 10 * 16) + (val % 10);
}
/*
used to convery binary coded decimal to standard
decimal numbers
Param: val -> the BCD value
Returns: the standard decimal representation of val
*/
static uint8_t bcdToDec(uint8_t val)
{
return (val / 16 * 10) + (val % 16);
}

@ -0,0 +1,254 @@
#ifndef GUARD_DS3231_H
#define GUARD_DS3231_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stdbool.h>
#define DS3231_ADDRESS_READ 0b11010001
#define DS3231_ADDRESS_WRITE 0b11010000
#define DS3231_OPERATION_SUCCESS 0 // this is returned if a function ran without errors
// general time keeping registers
#define DS3231_REGISTER_SECONDS 0
#define DS3231_REGISTER_MINUTES 0x1
#define DS3231_REGISTER_HOURS 0x2
#define DS3231_REGISTER_DAY 0x3
#define DS3231_REGISTER_DATE 0x4
#define DS3231_REGISTER_MONTH_CENTURY 0x5
#define DS3231_REGISTER_YEAR 0x6
// alarm 1 registers
#define DS3231_REGISTER_ALARM1_SECONDS 0x7
#define DS3231_REGISTER_ALARM1_MINUTES 0x8
#define DS3231_REGISTER_ALARM1_HOURS 0x9
#define DS3231_REGISTER_ALARM1_DAY_DATE 0xa
// alarm 1 trigger interval bits
#define DS3231_ALARM1_A1M1_BIT (1 << 7) // used to signal when an alarm should be triggered (e.g. every second etc.)
#define DS3231_ALARM1_A1M2_BIT (1 << 7) // used to signal when an alarm should be triggered (e.g. every second etc.)
#define DS3231_ALARM1_A1M3_BIT (1 << 7) // used to signal when an alarm should be triggered (e.g. every second etc.)
#define DS3231_ALARM1_A1M4_BIT (1 << 7) // used to signal when an alarm should be triggered (e.g. every second etc.)
// alarm 2 registers
#define DS3231_REGISTER_ALARM2_MINUTES 0xb
#define DS3231_REGISTER_ALARM2_HOURS 0xc
#define DS3231_REGISTER_ALARM2_DAY_DATE 0xd
// alarm 2 trigger interval bits
#define DS3231_ALARM2_A2M2_BIT (1 << 7) // used to signal when an alarm should be triggered (e.g. every second etc.)
#define DS3231_ALARM2_A2M3_BIT (1 << 7)
#define DS3231_ALARM2_A2M4_BIT (1 << 7)
// other alarm bits
#define DS3231_ALARM_DAY_BIT (1 << 6) // used to indicate if an alarm is set for a DAY or DATE
// control register
#define DS3231_REGISTER_CONTROL 0xe
// control register bits
#define DS3231_CONTROL_EOSC_BIT (1 << 7)
#define DS3231_CONTROL_BBQSW_BIT (1 << 6)
#define DS3231_CONTROL_CONV_BIT (1 << 5)
#define DS3231_CONTROL_RS2_BIT (1 << 4)
#define DS3231_CONTROL_RS1_BIT (1 << 3)
#define DS3231_CONTROL_INTCN_BIT (1 << 2) // enable interrupts
#define DS3231_CONTROL_A2IE_BIT (1 << 1) // enable alarm 2
#define DS3231_CONTROL_A1IE_BIT (1 << 0) // enable alarm 1
// status register
#define DS3231_REGISTER_STATUS 0xf
// status register bits
#define DS3231_STATUS_OSF_BIT (1 << 7) // oscillator stop
#define DS3231_STATUS_EN32KHZ_BIT (1 << 3) // enable 32KHz square wave output
#define DS3231_STATUS_BSY_BIT (1 << 2) // device busy bit
#define DS3231_STATUS_A2F_BIT (1 << 1) // alarm 2 triggered flag
#define DS3231_STATUS_A1F_BIT (1 << 0) // alarm 1 triggered flag
// aging register
#define DS3231_REGISTER_AGING_OFFSET 0x10
// temperature registers
#define DS3231_REGISTER_TEMPERATURE_MSB 0x11
#define DS3231_REGISTER_TEMPERATURE_LSB 0x12
// special toggle bits
#define DS3231_HOUR_MODE_12_BIT (1 << 6) // this will be 1 in the HOURS register if 12 hour mode is selected. 0 if 24 hour mode selected
#define DS3231_PM_BIT (1 << 5) // if using 12 hr mode, this bit is set in the HOURS register to indicate if the time is AM or PM with PM being indicated by a 1 and AM by a 0
#define DS3231_20_HOUR_BIT (1 << 5) // if using 24 hr mode, this bit is set in the HOURS register to indicate the hours between 20 and 23
#define DS3231_CENTURY_BIT (1 << 7) // in the month/century register bit 7 is set when a new century is entered
// possible days
typedef enum
{
DS_SUNDAY = 1, // must start from 1 according to datasheet
DS_MONDAY = 2,
DS_TUESDAY = 3,
DS_WEDNESDAY = 4,
DS_THURSDAY = 5,
DS_FRIDAY = 6,
DS_SATURDAY = 7,
DAY_T_MAX = 8
} day_t;
// possible months
typedef enum
{
DS_JANUARY = 1,
DS_FEBRUARY = 2,
DS_MARCH = 3,
DS_APRIL = 4,
DS_MAY = 5,
DS_JUNE = 6,
DS_JULY = 7,
DS_AUGUST = 8,
DS_SEPTEMBER = 9,
DS_OCTOBER = 10,
DS_NOVEMBER = 11,
DS_DECEMBER = 12,
MONTH_T_MAX = 13
} month_t;
// the available alarms of the ds3231
typedef enum
{
ALARM_1,
ALARM_2,
ALARM_NUMBER_T_MAX
} alarm_number_t;
// defines when alarms should be triggered, e.g. when seconds match
typedef enum
{
//////////////////////////
// ALARM1 (A1) triggers //
//////////////////////////
A1_EVERY_SEC, // triggers every second
A1_SEC_MATCH, // triggers when seconds value in ALARM1 seconds register match ds3231 seconds register
A1_MIN_SEC_MATCH, // triggers when seconds & min value the ALARM1 seconds & min registers match ds3231 seconds & min registers
A1_HOUR_MIN_SEC_MATCH, // triggers when hours, min & seconds value in ALARM1 respective registers match ds3231 hour, min & seconds registers
A1_DAY_DATE_HOUR_MIN_SEC_MATCH, // triggers when day/date, hours, min & seconds in ALARM1 register match the values in the ds3231 time & date registers
// depending on what is "useDay" is true in the alarm_t used selects whether the alarm triggers on a day or date
//////////////////////////
// ALARM2 (A2) triggers //
//////////////////////////
A2_EVERY_MIN, // triggers every minute (at 0 seconds of the new minute)
A2_MIN_MATCH, // triggers when ALARM2 minute register matches the ds3231 minute register
A2_HOUR_MIN_MATCH, // triggers when ALARM2 minute & hour register matches the ds3231 minute & hour registers
A2_DAY_DATE_HOUR_MIN_MATCH, // triggers when ALARM2 day/date, hour & min register match the ds3231 registers
// depending on what is "useDay" is true in the alarm_t used selects whether the alarm triggers on a day or date
ALARM_TRIGGER_T_MAX
} alarm_trigger_t;
// used to set alarms
typedef struct
{
alarm_number_t alarmNumber; // which alarm to set
uint8_t second; // the seconds value of the alarm, this is only valid for ALARM_1
uint8_t minute; // minutes value of alarm
uint8_t hour; // hour value of alarm
bool useDay; // if TRUE, then the value in the "dayDate" field is interpreted as the day_t to trigger the alarm
// e.g. THURSDAY.
// if FALSE, then the value in "dayDate" is interpreted as a numerical date value to trigger the alarm
// e.g. 12 (the 12th of the month)
uint8_t dayDate; // the day OR date of the alarm (depends on useDay);
alarm_trigger_t trigger; // when the alarm will trigger, e.g. on match on mins & seconds
} alarm_t;
// the frequencies the bbsqw can output
typedef enum
{
HZ_1, // 1 Hz
KHZ_1_024, // 1.024 KHz
KHZ_4_096, // 4.096 KHz
KHZ_8_192, // 8.192 KHz
BBSQW_FREQUENCY_MAX
} bbsqw_frequency_t;
////////////////////////////////////////////////////////////////
// Global variables //
////////////////////////////////////////////////////////////////
// used to track the century
static uint8_t century = 21; // year 20xx has a century of 21
// used to indicate the hour storing mode, either AM/PM (12 hour mode) or 24 hour mode
static bool is24HourMode = true;
////////////////////////////////////////////////////////////////
// Function prototypes //
////////////////////////////////////////////////////////////////
void initDS3231(void);
// time setting / getting functions
void ds3231Use12HourMode(bool);
uint8_t ds3231SetSecond(uint8_t);
uint8_t ds3231GetSecond(void);
uint8_t ds3231SetMinute(uint8_t);
uint8_t ds3231GetMinute(void);
uint8_t ds3231SetHour(uint8_t, bool);
uint8_t ds3231GetHour(void);
uint8_t ds3231SetDay(day_t);
day_t ds3231GetDay(void);
uint8_t ds3231SetDate(uint8_t);
uint8_t ds3231GetDate(void);
uint8_t ds3231SetMonth(month_t);
month_t ds3231GetMonth(void);
uint8_t ds3231SetYear(uint8_t);
uint8_t ds3231GetYear(void);
void ds3231SetCentury(uint8_t);
uint8_t ds3231GetCentury(void);
uint8_t ds3231SetFullDate(day_t, uint8_t, month_t, uint8_t, uint8_t);
uint8_t ds3231SetTime(uint8_t, uint8_t, uint8_t, bool);
// alarm functions
uint8_t ds3231SetAlarm(const alarm_t *);
uint8_t ds3231ClearAlarmFlag(alarm_number_t);
uint8_t ds3231RemoveAlarm(alarm_number_t);
// temperature functions
void ds3231ForceTemperatureUpdate(void);
int16_t ds3231GetTemperature(void);
// oscillator functions
uint8_t ds3231DisableOscillatorOnBattery(void);
uint8_t ds3231EnableOscillatorOnBattery(void);
bool ds3231HasOscillatorStopped(void);
// 32KHz output pin functions
uint8_t ds3231Enable32KHzOutput(void);
uint8_t ds3231Disable32KhzOutput(void);
// aging offset functions
uint8_t ds3231SetAgingOffset(int8_t);
int8_t ds3231GetAgingOffset(void);
// other functions
uint8_t ds3231EnableBBSQW(bbsqw_frequency_t);
// utility functions
uint8_t setRegisterPointer(uint8_t);
uint8_t getRegisterValue(uint8_t);
uint8_t writeValueThenStop(uint8_t, uint8_t);
#ifdef __cplusplus
}
#endif
#endif

@ -0,0 +1,201 @@
/*************************************************************************
* Title: I2C master library using hardware TWI interface
* Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
* File: $Id: twimaster.c,v 1.4 2015/01/17 12:16:05 peter Exp $
* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3
* Target: any AVR device with hardware TWI
* Usage: API compatible with I2C Software Library i2cmaster.h
**************************************************************************/
#include <inttypes.h>
#include <compat/twi.h>
#include <avr/io.h>
#include "i2cMaster.h"
/* define CPU frequency in hz here if not defined in Makefile */
#ifndef F_CPU
#define F_CPU 16000000UL
#endif
/* I2C clock in Hz */
#define SCL_CLOCK 100000L
/*************************************************************************
Initialization of the I2C bus interface. Need to be called only once
*************************************************************************/
void initI2C(void)
{
/* initialize TWI clock: 100 kHz clock, TWPS = 0 => prescaler = 1 */
TWI_BUS_PORT |= 1<<SCL|1<<SDA;
TWI_BUS_DDR &=~(1<<SCL|1<<SDA);
TWSR = 0; /* no prescaler */
TWBR = ((F_CPU/SCL_CLOCK)-16)/2; /* must be > 10 for stable operation */
}
/*************************************************************************
Issues a start condition and sends address and transfer direction.
return 0 = device accessible, 1= start condition didn't transmit,
2= master as transmitter/receiver didn't receive an ACK
*************************************************************************/
uint8_t i2cStart(uint8_t address)
{
uint8_t twst;
// send START condition
TWCR = (1 << TWINT | 1 << TWSTA | 1 << TWEN);
// wait until transmission completed
while(!(TWCR & (1 << TWINT)))
;
// check value of TWI Status Register. Mask prescaler bits.
twst = TW_STATUS & 0xF8;
if(twst != TW_START && twst != TW_REP_START)
return 1; // (repeated) start condition NOT transmitted
// send device address
TWDR = address;
TWCR = (1 << TWINT | 1 << TWEN);
// wail until transmission completed and ACK/NACK has been received
while(!(TWCR & (1 << TWINT)))
;
// check value of TWI Status Register. Mask prescaler bits.
twst = TW_STATUS & 0xF8;
if (twst != TW_MT_SLA_ACK && twst != TW_MR_SLA_ACK)
return 2; // master as transmitter/receiver didn't receive ACK
return 0;
}
/*************************************************************************
Issues a start condition and sends address and transfer direction.
If device is busy, use ack polling to wait until device is ready
Input: address and transfer direction of I2C device
*************************************************************************/
void i2cStartWait(uint8_t address)
{
uint8_t twst;
while (1)
{
// send START condition
TWCR = (1 << TWINT | 1 << TWSTA | 1 << TWEN);
// wait until transmission completed
while(!(TWCR & (1 << TWINT)))
;
// check value of TWI Status Register. Mask prescaler bits.
twst = TW_STATUS & 0xF8;
if ((twst != TW_START) && (twst != TW_REP_START))
continue;
// send device address
TWDR = address;
TWCR = (1 << TWINT | 1 << TWEN);
// wail until transmission completed
while(!(TWCR & (1 << TWINT)))
;
// check value of TWI Status Register. Mask prescaler bits.
twst = TW_STATUS & 0xF8;
if((twst == TW_MT_SLA_NACK) || (twst ==TW_MR_DATA_NACK))
{
/* device busy, send stop condition to terminate write operation */
TWCR = (1 << TWINT | 1 << TWEN | 1 << TWSTO);
// wait until stop condition is executed and bus released
while(TWCR & (1 << TWSTO))
;
continue;
}
break;
}
}
/*************************************************************************
Issues a repeated start condition and sends address and transfer direction
Input: address and transfer direction of I2C device
Return: 0 device accessible
1 failed to access device
*************************************************************************/
uint8_t i2cRepeatStart(uint8_t address)
{
return i2cStart(address);
}
/*************************************************************************
Terminates the data transfer and releases the I2C bus
*************************************************************************/
void i2cStop(void)
{
/* send stop condition */
TWCR = (1 << TWINT | 1 << TWEN | 1 << TWSTO);
// wait until stop condition is executed and bus released
while(TWCR & (1 << TWSTO))
;
}
/*************************************************************************
Send one byte to I2C device
Input: byte to be transfered
Return: 0 write successful
1 write failed
*************************************************************************/
uint8_t i2cWrite(uint8_t data)
{
uint8_t twst;
// send data to the previously addressed device
TWDR = data;
TWCR = (1 << TWINT | 1 << TWEN);
// wait until transmission completed
while(!(TWCR & (1 << TWINT)))
;
// check value of TWI Status Register. Mask prescaler bits
twst = TW_STATUS & 0xF8;
if(twst != TW_MT_DATA_ACK)
return 1;
return 0;
}
/*************************************************************************
Read one byte from the I2C device, request more data from device
Return: byte read from I2C device
*************************************************************************/
uint8_t i2cReadAck(void)
{
TWCR = (1 << TWINT | 1 << TWEN | 1 << TWEA);
while(!(TWCR & (1 << TWINT)))
;
return TWDR;
}
/*************************************************************************
Read one byte from the I2C device, read is followed by a stop condition
Return: byte read from I2C device
*************************************************************************/
uint8_t i2cReadNak(void)
{
TWCR = (1 << TWINT | 1 << TWEN);
while(!(TWCR & (1 << TWINT)))
;
return TWDR;
}

@ -0,0 +1,136 @@
#ifndef GUARD_I2CMASTER_H
#define GUARDG_I2CMASTER_H
/*************************************************************************
* Title: C include file for the I2C master interface
* (i2cmaster.S or twimaster.c)
* Author: Peter Fleury <pfleury@gmx.ch>
* File: $Id: i2cmaster.h,v 1.12 2015/09/16 09:27:58 peter Exp $
* Software: AVR-GCC 4.x
* Target: any AVR device
* Usage: see Doxygen manual
**************************************************************************/
/**
@file
@defgroup pfleury_ic2master I2C Master library
@code #include <i2cmaster.h> @endcode
@brief I2C (TWI) Master Software Library
Basic routines for communicating with I2C slave devices. This single master
implementation is limited to one bus master on the I2C bus.
This I2c library is implemented as a compact assembler software implementation of the I2C protocol
which runs on any AVR (i2cmaster.S) and as a TWI hardware interface for all AVR with built-in TWI hardware (twimaster.c).
Since the API for these two implementations is exactly the same, an application can be linked either against the
software I2C implementation or the hardware I2C implementation.
Use 4.7k pull-up resistor on the SDA and SCL pin.
Adapt the SCL and SDA port and pin definitions and eventually the delay routine in the module
i2cmaster.S to your target when using the software I2C implementation !
Adjust the CPU clock frequence F_CPU in twimaster.c or in the Makfile when using the TWI hardware implementaion.
@note
The module i2cmaster.S is based on the Atmel Application Note AVR300, corrected and adapted
to GNU assembler and AVR-GCC C call interface.
Replaced the incorrect quarter period delays found in AVR300 with
half period delays.
@author Peter Fleury pfleury@gmx.ch http://tinyurl.com/peterfleury
@copyright (C) 2015 Peter Fleury, GNU General Public License Version 3
- modified for better readability and error return codes
*/
/**@{*/
#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304
#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !"
#endif
#include <stdint.h>
/** defines the data direction (reading from I2C device) in i2c_start(),i2c_rep_start() */
#define I2C_READ 1
/** defines the data direction (writing to I2C device) in i2c_start(),i2c_rep_start() */
#define I2C_WRITE 0
#define TWI_BUS_PORT PORTD //PORTC
#define TWI_BUS_DDR DDRD //DDRC
#define SDA PD1 //PC1
#define SCL PD0 //PC0
/**
@brief initialize the I2C master interace. Need to be called only once
@return none
*/
void initI2C(void);
/**
@brief Terminates the data transfer and releases the I2C bus
@return none
*/
void i2cStop(void);
/**
@brief Issues a start condition and sends address and transfer direction
@param addr address and transfer direction of I2C device
@retval 0 device accessible
@retval 1 failed to access device
*/
uint8_t i2cStart(uint8_t addr);
/**
@brief Issues a repeated start condition and sends address and transfer direction
@param addr address and transfer direction of I2C device
@retval 0 device accessible
@retval 1 failed to access device
*/
uint8_t i2cRepeatStart(uint8_t addr);
/**
@brief Issues a start condition and sends address and transfer direction
If device is busy, use ack polling to wait until device ready
@param addr address and transfer direction of I2C device
@return none
*/
void i2cStartWait(uint8_t addr);
/**
@brief Send one byte to I2C device
@param data byte to be transfered
@retval 0 write successful
@retval 1 write failed
*/
uint8_t i2cWrite(uint8_t data);
/**
@brief read one byte from the I2C device, request more data from device
@return byte read from I2C device
*/
uint8_t i2cReadAck(void);
/**
@brief read one byte from the I2C device, read is followed by a stop condition
@return byte read from I2C device
*/
uint8_t i2cReadNak(void);
/**
@brief read one byte from the I2C device
Implemented as a macro, which calls either @ref i2c_readAck or @ref i2c_readNak
@param ack 1 send ack, request more data from device<br>
0 send nak, read is followed by a stop condition
@return byte read from I2C device
*/
uint8_t i2cRead(uint8_t ack);
/**@}*/
#endif

@ -0,0 +1,552 @@
//
// Created by dipak on 18.05.18.
//
#include "Serial.h"
#include <stdlib.h>
Serial Debug(0);
Serial *Serial::Serial0 = nullptr;
//Serial *Serial::Serial1 = nullptr;
Serial *Serial::Serial2 = nullptr;
Serial *Serial::Serial3 = nullptr;
Serial::Serial(const uint8_t port)
{
this->portNumber = port;
switch (portNumber) {
case 0:
if (Serial0 == nullptr) {
this->UDRn = &UDR0;
this->UCSRnA = &UCSR0A;
this->UCSRnB = &UCSR0B;
this->UCSRnC = &UCSR0C;
this->UBRRnH = &UBRR0H;
this->UBRRnL = &UBRR0L;
this->TXENn = TXEN0;
this->RXENn = RXEN0;
this->UDREn = UDRE0;
this->U2Xn = U2X0;
this->RXCIEn = RXCIE0;
this->USBSn = USBS0;
this->UPMn0 = UPM00;
this->UPMn1 = UPM01;
this->UCSZn0 = UCSZ00;
this->UCSZn1 = UCSZ01;
this->UCSZn2 = UCSZ02;
this->UMSELn0 = UMSEL00;
this->UMSELn1 = UMSEL01;
this->UDRIEn = UDRIE0;
Serial0 = this;
}
break;
/*
case 1:
if (Serial1 == nullptr) {
this->UDRn = &UDR1;
this->UCSRnA = &UCSR1A;
this->UCSRnB = &UCSR1B;
this->UCSRnC = &UCSR1C;
this->UBRRnH = &UBRR1H;
this->UBRRnL = &UBRR1L;
this->TXENn = TXEN1;
this->RXENn = RXEN1;
this->UDREn = UDRE1;
this->U2Xn = U2X1;
this->RXCIEn = RXCIE1;
this->USBSn = USBS1;
this->UPMn0 = UPM10;
this->UPMn1 = UPM11;
this->UCSZn0 = UCSZ10;
this->UCSZn1 = UCSZ11;
this->UCSZn2 = UCSZ12;
this->UMSELn0 = UMSEL10;
this->UMSELn1 = UMSEL11;
this->UDRIEn = UDRIE1;
Serial1 = this;
}
break;
*/
case 2:
if (Serial2 == nullptr) {
this->UDRn = &UDR2;
this->UCSRnA = &UCSR2A;
this->UCSRnB = &UCSR2B;
this->UCSRnC = &UCSR2C;
this->UBRRnH = &UBRR2H;
this->UBRRnL = &UBRR2L;
this->TXENn = TXEN2;
this->RXENn = RXEN2;
this->UDREn = UDRE2;
this->U2Xn = U2X2;
this->RXCIEn = RXCIE2;
this->USBSn = USBS2;
this->UPMn0 = UPM20;
this->UPMn1 = UPM21;
this->UCSZn0 = UCSZ20;
this->UCSZn1 = UCSZ21;
this->UCSZn2 = UCSZ22;
this->UMSELn0 = UMSEL20;
this->UMSELn1 = UMSEL21;
this->UDRIEn = UDRIE2;
Serial2 = this;
}
break;
case 3:
if (Serial3 == nullptr) {
this->UDRn = &UDR3;
this->UCSRnA = &UCSR3A;
this->UCSRnB = &UCSR3B;
this->UCSRnC = &UCSR3C;
this->UBRRnH = &UBRR3H;
this->UBRRnL = &UBRR3L;
this->TXENn = TXEN3;
this->RXENn = RXEN3;
this->UDREn = UDRE3;
this->U2Xn = U2X3;
this->RXCIEn = RXCIE3;
this->USBSn = USBS3;
this->UPMn0 = UPM30;
this->UPMn1 = UPM31;
this->UCSZn0 = UCSZ30;
this->UCSZn1 = UCSZ31;
this->UCSZn2 = UCSZ32;
this->UMSELn0 = UMSEL30;
this->UMSELn1 = UMSEL31;
this->UDRIEn = UDRIE3;
Serial3 = this;
}
break;
default:break;
}
}
/*!
* Function to initialise USART communication
* @param baud The USART communication baud rate - defaulted to 9600
* @param mode Sets the operating mode. Either Asynchronous Normal mode, Asynchronous Double Speed mode or Synchronous
* Master mode. Possible value are:
* ASYNC_NORMAL = 0,
* ASYNC_DOUBLE_SPEED = 1,
* SYNC_MASTER = 2
* @param parity Sets the parity bit - defaulted to NONE. Possible values are:
* NONE = 0,
* EVEN = 2,
* ODD = 3
* @param stopBits Sets the number of stop bits - default to ONE. Possible values are:
* ONE = 1,
* TWO = 2
* @param frameLength Sets the number of bits per frame - default value of 8 bits(EIGHT_BITS). Possible values are:
* FIVE_BITS = 5,
* SIX_BITS = 6,
* SEVEN_BITS = 7,
* EIGHT_BITS = 8,
* NINE_BITS = 9
*/
void Serial::begin(const uint32_t baud,
const USARTOperatingMode mode,
const USARTParity parity,
const USARTStopBits stopBits,
const USARTFrameLength frameLength)
{
this->Parity = parity;
this->setParity(Parity);
this->StopBits = stopBits;
this->setStopBit(StopBits);
this->FrameLength = frameLength;
this->setFrameLength(FrameLength);
this->flushBuffer();
/* Enable receiver and transmitter */
*(this->UCSRnB) |= (1 << this->TXENn);
*(this->UCSRnB) |= (1 << this->RXENn);
*(this->UCSRnB) |= (1 << this->RXCIEn);
this->OperatingMode = mode;
this->setOpMode(baud, OperatingMode);
}
/*!
* Function sets the Sets the operating mode. Either Asynchronous Normal mode, Asynchronous Double Speed mode or
* Synchronous Master mode
* @param baud The USART communication baud rate
* @param mode The desired operating mode
*/
void Serial::setOpMode(const uint32_t baud,
const enum USARTOperatingMode mode)
{
uint16_t bRate = 0;
// compute baud rate value for UBRR register
/***********************************************************************/
/*UMSELn Bits Settings */
/* UMSELn1 UMSELn0 Mode */
/* 0 0 Asynchronous USART */
/* 0 1 Synchronous USART */
/* 1 0 (Reserved) */
/* 1 1 Master SPI (MSPIM) */
/***********************************************************************/
switch (mode) {
case USARTOperatingMode::SYNC_MASTER:bRate = static_cast<uint16_t>((F_CPU / 2 / baud - 1) / 2);
*(this->UCSRnC) |= (1 << this->UMSELn0);
*(this->UCSRnC) &= ~(1 << this->UMSELn1);
break;
case USARTOperatingMode::ASYNC_DOUBLE_SPEED:bRate = static_cast<uint16_t>((F_CPU / 4 / baud - 1) / 2);
// UMSELn0 = 0 and UMSELn1 = 0 for asynchronous mode
*(this->UCSRnC) &= ~(1 << this->UMSELn0);
*(this->UCSRnC) &= ~(1 << this->UMSELn1);
break;
case USARTOperatingMode::ASYNC_NORMAL:bRate = static_cast<uint16_t>((F_CPU / 16 / baud) - 1);
// UMSELn0 = 0 and UMSELn1 = 0 for asynchronous mode
*(this->UCSRnC) &= ~(1 << this->UMSELn0);
*(this->UCSRnC) &= ~(1 << this->UMSELn1);
break;
}
*(this->UBRRnH) = (uint8_t) (bRate >> 8);
*(this->UBRRnL) = (uint8_t) (bRate & 0xFF);
}
/*!
* Function to set the number of bits per frame
* @param frameLength The frame length value. Possible values are:
* FIVE_BITS = 5,
* SIX_BITS = 6,
* SEVEN_BITS = 7,
* EIGHT_BITS = 8,
* NINE_BITS = 9
*/
void Serial::setFrameLength(enum USARTFrameLength frameLength)
{
/************************************************************************/
/* @method */
/* Set UART/USART frame length (5 to 9 bits) */
/* @param frameLength */
/* the frame length - values from USARTFrameLength.xxx */
/* UCSZn Bits Settings */
/* UCSZn2 UCSZn1 UCSZn0 Character Size */
/* 0 0 0 5-bit */
/* 0 0 1 6-bit */
/* 0 1 0 7-bit */
/* 0 1 1 8-bit */
/* 1 1 1 9-bit */
/************************************************************************/
switch (frameLength) {
case USARTFrameLength::FIVE_BITS:*(this->UCSRnC) &= ~(1 << this->UCSZn0);
*(this->UCSRnC) &= ~(1 << this->UCSZn1);
*(this->UCSRnB) &= ~(1 << this->UCSZn2);
break;
case USARTFrameLength::SIX_BITS:*(this->UCSRnC) |= (1 << this->UCSZn0);
*(this->UCSRnC) &= ~(1 << this->UCSZn1);
*(this->UCSRnB) &= ~(1 << this->UCSZn2);
break;
case USARTFrameLength::SEVEN_BITS:*(this->UCSRnC) &= ~(1 << this->UCSZn0);
*(this->UCSRnC) |= (1 << this->UCSZn1);
*(this->UCSRnB) &= ~(1 << this->UCSZn2);
break;
case USARTFrameLength::EIGHT_BITS:*(this->UCSRnC) |= (1 << this->UCSZn0);
*(this->UCSRnC) |= (1 << this->UCSZn1);
*(this->UCSRnB) &= ~(1 << this->UCSZn2);
break;
case USARTFrameLength::NINE_BITS:
// set data transmission mode: 9-bit (UCSZn2 = 1; UCSZn1 = 1; UCSZn0 = 1;)
*(this->UCSRnC) |= (1 << this->UCSZn0);
*(this->UCSRnC) |= (1 << this->UCSZn1);
*(this->UCSRnB) |= (1 << this->UCSZn2);
break;
default: // Defaulting to 8 bits
*(this->UCSRnC) |= (1 << this->UCSZn0);
*(this->UCSRnC) |= (1 << this->UCSZn1);
*(this->UCSRnB) &= ~(1 << this->UCSZn2);
break;
}
}
/*!
* Function sets the number of stop bits to be used in the USART communication
* @param stopBit Sets the number of stop bits - default to ONE. Possible values are:
* ONE = 1,
* TWO = 2
*/
void Serial::setStopBit(USARTStopBits stopBit)
{
/************************************************************************/
/* @method */
/* Set UART/USART transmission stop bit */
/* @param stopBit */
/* the stop bit - values from StopBits.xxx */
/* USBS Bit Settings */
/* USBSn = 0 => 1 Stop bit */
/* USBSn = 1 => 2 Stop bit */
/************************************************************************/
switch (stopBit) {
// one stop bit
case USARTStopBits::ONE:*(this->UCSRnC) &= ~(1 << this->USBSn);
break;
// two stop bits
case USARTStopBits::TWO:*(this->UCSRnC) |= (1 << this->USBSn);
break;
}
}
/*!
* Function sets the partity bits to be used for the USART communication
* @param parity Sets the parity bit - defaulted to NONE. Possible values are:
* NONE = 0,
* EVEN = 2,
* ODD = 3
*/
void Serial::setParity(enum USARTParity parity)
{
/************************************************************************/
/* @method */
/* Set UART/USART transmission parity */
/* @param parity */
/* the parity - values from USARTParity.xxx */
/* UPMn Bits Settings */
/* UPMn1 UPMn0 Parity Mode */
/* 0 0 Disabled */
/* 0 1 Reserved */
/* 1 0 Enabled, Even Parity */
/* 1 1 Enabled, Odd Parity */
/************************************************************************/
switch (parity) {
case USARTParity::NONE:*(this->UCSRnC) &= ~(1 << this->UPMn0);
*(this->UCSRnC) &= ~(1 << this->UPMn1);
break;
case USARTParity::EVEN:*(this->UCSRnC) &= ~(1 << this->UPMn0);
*(this->UCSRnC) |= (1 << this->UPMn1);
break;
case USARTParity::ODD:*(this->UCSRnC) |= (1 << this->UPMn0);
*(this->UCSRnC) |= (1 << this->UPMn1);
break;
}
}
/*!
* Clear the buffers - reset buffer pointers to their initial state
* @return Either true or False.
*/
bool Serial::clear()
{
/************************************************************************/
/* @method */
/* Clear the buffers - reset buffer pointers to their initial state */
/* @return true so it can be used in logical expressions with ease */
/************************************************************************/
bool txEnabled = (*(this->UCSRnB) & (1 << this->TXENn)) > 0;
// disable USART data receiving until clearing the buffer
if (txEnabled) {
*(this->UCSRnB) &= ~(1 << this->TXENn);
}
this->flushBuffer();
if (txEnabled) {
*(this->UCSRnB) |= (1 << this->TXENn);
}
return true;
}
/*!
* Function flushes the transmission and receive buffer indices
*/
void Serial::flushBuffer()
{
this->rxHeadIndex = 0;
this->rxTailIndex = 0;
this->txHeadIndex = 0;
this->txTailIndex = 0;
}
/*!
* Function reads one byte at a time from the receiver buffer, and increments the tail index by one
* @return one byte from the receiver buffer
*/
uint8_t Serial::read()
{
uint8_t tmptail;
/* calculate /store buffer index */
tmptail = static_cast<uint8_t>((this->rxTailIndex + 1) & (BUFFER_SIZE - 1));
this->rxTailIndex = tmptail;
/* get data from receive buffer */
if (rxBuffer[tmptail] == TERMINATOR) this->pending--; //Read one complete msg
return rxBuffer[tmptail];
}
/*!
* Function to transmit one byte of data
* @param data Data to be transmitted
*/
void Serial::write(const uint8_t data)
{
// Create a temporary index to point to the head of the buffer
uint8_t tmp_head_index;
// Calculate the next value of the head index
tmp_head_index = static_cast<uint8_t>((txHeadIndex + 1) & (BUFFER_SIZE - 1));
while (tmp_head_index == Serial::txTailIndex) { ;/* wait for free space in buffer */
}
// Load data into the transmission buffer and the next free position i.e., tmp_head_index
txBuffer[tmp_head_index] = data;
// Update global index to the incremented value
txHeadIndex = tmp_head_index;
// Enable UDRE interrupt
*(this->UCSRnB) |= (1 << this->UDRIEn); // enable UDRE interrupt
}
/*!
* Function to transmit a char array. Overloaded write() function
* @param data Pointer to the a char array
*/
void Serial::write(const char *data)
{
while ((*data) != '\0') // Looping until end of char array '\0' is encountered
write(static_cast<uint8_t>(*data++));
}
void Serial::writeln(const char *data = "")
{
while ((*data) != '\0') // Looping until end of char array '\0' is encountered
write(static_cast<uint8_t>(*data++));
write(static_cast<uint8_t>('\n'));
}
void Serial::write(char data)
{
write(static_cast<const uint8_t>(data));
}
void Serial::write(const uint8_t *data)
{
while ((*data) != '\0') // Looping until end of char array '\0' is encountered
write(static_cast<const uint8_t>(*data++));
}
uint8_t Serial::msgPending()
{
return this->pending;
}
/*!
* Functions lets know if there is any data received on the receiver buffer
* @return
*/
bool Serial::rxDataAvailable()
{
return rxHeadIndex != rxTailIndex;
}
/*!
* Destructor
*/
Serial::~Serial()
{
}
// Rx & UDRE vectors for USART0
#if defined(HAS_USART0)
void USART0_RX_vect()
{
Serial::Serial0->handleRXInterrupt();
}
void USART0_UDRE_vect()
{
Serial::Serial0->handleUDREInterrupt();
}
#endif
// Rx & UDRE vectors for USART1
#if defined(HAS_USART1)
void USART1_RX_vect()
{
Serial::Serial1->handleRXInterrupt();
}
void USART1_UDRE_vect()
{
Serial::Serial1->handleUDREInterrupt();
}
#endif
// Rx & UDRE vectors for USART2
#if defined(HAS_USART2)
void USART2_RX_vect()
{
Serial::Serial2->handleRXInterrupt();
}
void USART2_UDRE_vect()
{
Serial::Serial2->handleUDREInterrupt();
}
#endif
// Rx & UDRE vectors for USART3
#if defined(HAS_USART3)
void USART3_RX_vect()
{
Serial::Serial3->handleRXInterrupt();
}
void USART3_UDRE_vect()
{
Serial::Serial3->handleUDREInterrupt();
}
#endif
/*!
* Function handles the RX interrupts across all the static instances
*/
void Serial::handleRXInterrupt()
{
/* Calculate buffer index */
uint8_t temp_head = static_cast<uint8_t>((this->rxHeadIndex + 1) & (BUFFER_SIZE - 1));
if (temp_head == this->rxTailIndex) {
/* ERROR! Receive buffer overflow */
/* Do nothing for now */
}
else {
this->rxHeadIndex = temp_head;
this->rxBuffer[this->rxHeadIndex] = *(this->UDRn);
if (this->rxBuffer[this->rxHeadIndex]== TERMINATOR) this->pending++;
}
}
/*!
* Function handles the UDRE interrupts across all the static instances
*/
void Serial::handleUDREInterrupt()
{
unsigned char temp_tail;
/* Check if all data is transmitted */
if (this->txHeadIndex != this->txTailIndex) {
/* Calculate buffer index */
temp_tail = static_cast<unsigned char>((this->txTailIndex + 1) & (BUFFER_SIZE - 1));
/* Store new index */
this->txTailIndex = temp_tail;
/* Start transmission */
*(this->UDRn) = this->txBuffer[temp_tail];
}
else {
*(this->UCSRnB) &= ~(1 << this->UDRIEn); // disable UDRE interrupt
}
}

@ -0,0 +1,230 @@
//
// Created by dipak on 18.05.18.
//
#ifndef ATMEGA_SERIAL_H
#define ATMEGA_SERIAL_H
#ifndef F_CPU
#define F_CPU 16000000
#endif
#include <avr/interrupt.h>
#if defined(UBRR0H)
#define HAS_USART0
#endif
#if defined(UBRR1H)
//#define HAS_USART1
#endif
#if defined(UBRR2H)
#define HAS_USART2
#endif
#if defined(UBRR3H)
#define HAS_USART3
#endif
/****************************************************************/
/* Defining ISR vectors */
/****************************************************************/
extern "C" void USART0_RX_vect(void) __attribute__ ((signal));
extern "C" void USART0_UDRE_vect(void) __attribute__ ((signal));
//extern "C" void USART1_RX_vect(void) __attribute__ ((signal));
//extern "C" void USART1_UDRE_vect(void) __attribute__ ((signal));
extern "C" void USART2_RX_vect(void) __attribute__ ((signal));
extern "C" void USART2_UDRE_vect(void) __attribute__ ((signal));
extern "C" void USART3_RX_vect(void) __attribute__ ((signal));
extern "C" void USART3_UDRE_vect(void) __attribute__ ((signal));
#define TERMINATOR '\r'
/****************************************************************/
/* Enumeration of communication modes supported by USART */
/****************************************************************/
enum class USARTOperatingMode
{
ASYNC_NORMAL = 0, /*!<Asynchronous Normal mode */
ASYNC_DOUBLE_SPEED = 1, /*!<Asynchronous Double Speed */
SYNC_MASTER = 2 /*!<Synchronous Master mode */
};
/****************************************************************/
/* Enumeration defining communication parity modes */
/****************************************************************/
enum class USARTParity
{
NONE = 0,
EVEN = 2,
ODD = 3
};
/****************************************************************/
/* Enumeration defining communication stop bits */
/****************************************************************/
enum class USARTStopBits
{
ONE = 1,
TWO = 2
};
/****************************************************************/
/* Enumeration defining communication frame length */
/****************************************************************/
enum class USARTFrameLength
{
FIVE_BITS = 5,
SIX_BITS = 6,
SEVEN_BITS = 7,
EIGHT_BITS = 8,
NINE_BITS = 9
};
class Serial
{
public:
explicit Serial(uint8_t port);
~Serial();
static const uint32_t BUFFER_SIZE = 128;
void begin(uint32_t baud,
USARTOperatingMode mode = USARTOperatingMode::ASYNC_NORMAL,
USARTParity parity = USARTParity::NONE,
USARTStopBits stopBits = USARTStopBits::ONE,
USARTFrameLength frameLength = USARTFrameLength::EIGHT_BITS);
void setFrameLength(USARTFrameLength frameLength);
void setStopBit(USARTStopBits stopBit);
void setParity(USARTParity parity);
void setOpMode(uint32_t baud, USARTOperatingMode mode);
bool clear();
void flushBuffer();
uint8_t read();
void write(uint8_t data);
void write(const char *data);
void writeln(const char *data);
void write(const uint8_t *data);
void write(char data);
uint8_t msgPending();
bool rxDataAvailable();
// friend operation which deals with USARTn_RX_vector(s) interrupts
// using friend operation allows to access private fields of this class
friend void USART0_RX_vect(void);
friend void USART0_UDRE_vect(void);
friend void USART1_RX_vect(void);
friend void USART1_UDRE_vect(void);
friend void USART2_RX_vect(void);
friend void USART2_UDRE_vect(void);
friend void USART3_RX_vect(void);
friend void USART3_UDRE_vect(void);
private:
#if defined(HAS_USART0)
static Serial *Serial0; /*!< Static member for Serial port 0*/
#endif
#if defined(HAS_USART1)
static Serial *Serial1; /*!< Static member for Serial port 0*/
#endif
#if defined(HAS_USART2)
static Serial *Serial2; /*!< Static member for Serial port 0*/
#endif
#if defined(HAS_USART3)
static Serial *Serial3; /*!< Static member for Serial port 0*/
#endif
uint8_t portNumber; /*!< Serial communication port number*/
USARTOperatingMode OperatingMode;
USARTParity Parity;
USARTStopBits StopBits;
USARTFrameLength FrameLength;
inline void handleRXInterrupt(); /*!< Private function to handle RX interrupt calls*/
inline void handleUDREInterrupt(); /*!< Private function to handle UDRE interrupt calls*/
/** MCU used registry */
volatile uint8_t *UDRn;
volatile uint8_t *UCSRnA;
volatile uint8_t *UCSRnB;
volatile uint8_t *UCSRnC;
volatile uint8_t *UBRRnH;
volatile uint8_t *UBRRnL;
// Buffer Setup
// Receiving buffer - Rx
volatile uint8_t pending;
volatile uint8_t rxBuffer[BUFFER_SIZE]; /*!< Receiver buffer to hold values received from USART */
volatile uint8_t rxHeadIndex; /*!< Receiver buffer head index. Indexes to the oldest values within the buffer
* that hasn't been read yet */
volatile uint8_t rxTailIndex; /*!< Receiver buffer tail index. Indexes to the latest value that was received */
// Transmission buffer - Rx
volatile uint8_t txBuffer[BUFFER_SIZE]; /*!< Transmission buffer to hold values before being sent on the USART */
volatile uint8_t txHeadIndex; /*!< Transmission buffer head index. Indexes to the latest value written to the
* transmission buffer*/
volatile uint8_t txTailIndex; /*!< Transmission buffer tail index. Indexes to the value that shall be
* transmitted when USART line is free*/
/* MCU dependent registry bits (positions) */
// TXENn: Transmitter Enable n
// Writing this bit to one enables the USART Transmitter. The Transmitter will override normal port operation for the
//TxDn pin when enabled. The disabling of the Transmitter (writing TXENn to zero) will not become effective until
//ongoing and pending transmissions are completed, that is, when the Transmit Shift Register and Transmit Buffer
//Register do not contain data to be transmitted. When disabled, the Transmitter will no longer override the TxDn
//port.
uint8_t TXENn;
// UDREn: USART Data Register Empty
// The UDREn Flag indicates if the transmit buffer (UDRn) is ready to receive new data. If UDREn is one, the buffer is
//empty, and therefore ready to be written. The UDREn Flag can generate a Data Register Empty interrupt (see
//description of the UDRIEn bit).
uint8_t RXENn;
// UDREn: USART Data Register Empty
//The UDREn Flag indicates if the transmit buffer (UDRn) is ready to receive new data. If UDREn is one, the buffer is
//empty, and therefore ready to be written. The UDREn Flag can generate a Data Register Empty interrupt (see
//description of the UDRIEn bit).
//UDREn is set after a reset to indicate that the Transmitter is ready.
uint8_t UDREn;
// U2Xn: Double the USART Transmission Speed
//This bit only has effect for the asynchronous operation. Write this bit to zero when using synchronous operation.
//Writing this bit to one will reduce the divisor of the baud rate divider from 16 to 8 effectively doubling the transfer
//rate for asynchronous communication.
uint8_t U2Xn;
// RXCIEn: RX Complete Interrupt Enable n
//Writing this bit to one enables interrupt on the RXCn Flag. A USART Receive Complete interrupt will be generated
//only if the RXCIEn bit is written to one, the Global Interrupt Flag in SREG is written to one and the RXCn bit in
//UCSRnA is set.
uint8_t RXCIEn;
// USBSn: Stop Bit Select
//This bit selects the number of stop bits to be inserted by the Transmitter. The Receiver ignores this setting.
uint8_t USBSn;
// UPMn1:0: Parity Mode
//These bits enable and set type of parity generation and check. If enabled, the Transmitter will automatically generate
//and send the parity of the transmitted data bits within each frame. The Receiver will generate a parity value for
//the incoming data and compare it to the UPMn setting. If a mismatch is detected, the UPEn Flag in UCSRnA will be
//set.
uint8_t UPMn0;
uint8_t UPMn1;
// UCSZn1:0: Character Size
//The UCSZn1:0 bits combined with the UCSZn2 bit in UCSRnB sets the number of data bits (Character SiZe) in a
//frame the Receiver and Transmitter use.
uint8_t UCSZn0;
uint8_t UCSZn1;
uint8_t UCSZn2;
// UMSELn1:0 USART Mode Select
//These bits select the mode of operation of the USARTn
uint8_t UMSELn0;
uint8_t UMSELn1;
// UDRIEn: USART Data Register Empty Interrupt Enable n
//Writing this bit to one enables interrupt on the UDREn Flag. A Data Register Empty interrupt will be generated only
//if the UDRIEn bit is written to one, the Global Interrupt Flag in SREG is written to one and the UDREn bit in UCSRnA
//is set.
uint8_t UDRIEn;
};
extern Serial Debug;
#endif //ATMEGA_SERIAL_H

@ -0,0 +1,4 @@
/build
/debug
/dist
/.generated_files

@ -0,0 +1,18 @@
#ifndef EEMEM_H_
#define EEMEM_H_
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
typedef struct{
uint8_t BOOTFLAG; //DoNotMove
uint8_t EEPROM_IDIBUS_InitGroup; //DoNotMove
uint8_t EEPROM_SN[IDISN_VARP_LENGTH]; //DoNotMove
//Add new things here
// ||
// ||
// \/
} EEPROM_DATABLOCKS;
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EEMEM EEPROM_DATABLOCKS EEBLOCK; //DYNAMIC PART
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#endif /* EEMEM_H_ */

@ -0,0 +1,27 @@
#ifndef BOOT_H_
#define BOOT_H_
#include <stdint.h>
#define BOOT_VERSION_MAJOR 1
#define BOOT_VERSION_MINOR 1
//Struct that is recieved by module from updater
typedef struct {
//[BLOCK 1]
uint32_t FmwHash; //CRC32
uint16_t FmwSizeInPages;
uint8_t ModuleType[3];
uint8_t HwRevision[2];
uint8_t Reserved1[5];
//[BLOCK 2]
uint8_t SwVersion[2]; //uint8_t[2]
uint8_t Reserved2[10];
uint32_t InfoHash;
} FMW_INFO;
#endif /* BOOT_H_ */

@ -0,0 +1,115 @@
#ifndef CONFIG_H_
#define CONFIG_H_
#include <inttypes.h>
#include <avr/io.h>
//Configure project
//Select MCU in project properties
//Undefine this if needed
#define _DEBUG_
//#define _NO_BOOTLOADER_
//Choose one
#define _SLAVE_MODULE_
//#define _SLAVE_EXT_
//#define _CUSTOM_TYPE_
//After this see idibus_hw.h to change PIN definition
//Done!
//For 328pb
#ifdef __ATmega328PB__
#define FLASH_SIZE 256*1024
//DONT FORGET TO CHANGE LINKER OPTIONS!!!!
#define locationInBoot (0x3FE8UL) //CAREFUL ONLY 48 byte in size for data
#define locationInApp (0x37C0UL)
//FUSES
#define F_Low 0xE0
#define F_Ext 0xFC
#ifdef _DEBUG_
#define F_High 0xC0 //Allow DebugWIRE + EEPROM save
#define F_Lock 0xFF //Disable LOCKS
#else
#define F_High 0xC8 //No DEBUG thing + No EEPROM save
#define F_Lock 0xCC
#endif
#define SRAM_size 2048UL
#endif
//For 2560
#ifdef __ATmega2560__
#define _LONG_ADDR_SPACE_
#define _FAT_CRC_
#define FLASH_SIZE 256*1024
//Settings in the linker
#define locationInBoot (0x1FF80ULL)
#define locationInApp (0x1EF80ULL)
//FUSES
#define F_Low 0xE0
#define F_Ext 0xFC
#ifdef _DEBUG_
#define F_High 0x00 //Enable JTAG and OCD + EEPROM save + no bootloader
#define F_Lock 0xFF //Disable LOCKS
#else
#define F_High 0xC8 //No DEBUG thing + No EEPROM save
#define F_Lock 0xCC
#endif
#define SRAM_size 8192UL
#endif
//For 1280
#ifdef __ATmega1280__
#define _LONG_ADDR_SPACE_
#define _FAT_CRC_
#define FLASH_SIZE 128*1024
//Settings in the linker
#define locationInBoot (0x0FF80ULL)
#define locationInApp (0x0EF80ULL)
//FUSES
#define F_Low 0xE0
#define F_Ext 0xFC
#ifdef _DEBUG_
#define F_High 0x00 //Enable JTAG and OCD + EEPROM save
#define F_Lock 0xFF //Disable LOCKS
#else
#define F_High 0xC8 //No DEBUG thing + No EEPROM save
#define F_Lock 0xCC
#endif
#define SRAM_size 8192UL
#endif
//COMMON Define
#define PAGE_COUNT (((locationInApp*2)/SPM_PAGESIZE)+1)
#define LAST_FLASH_PAGE_ADDRW ((FLASH_SIZE - SPM_PAGESIZE)/2)
#endif /* CONFIG_H_ */

@ -0,0 +1,90 @@
#include "idibus_hw.h"
#include "config.h"
//=============================================================================
// RSLINK MCU SPECIFIC FUNCTIONS SECTION
//=============================================================================
#ifdef _SLAVE_MODULE_
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// FOR 328pb
void RSLink_DipsInit(void) // Dip switch Adders, Speed, Bus Type Init
{
RSLINK_ADDR_DDR&=~(RSLINK_ADDR_MASK);
RSLINK_ADDR_PORT&=~(RSLINK_ADDR_MASK);
RSLINK_SPEED_DDR&=~(RSLINK_SPEED_MASK);
RSLINK_SPEED_PORT&=~(RSLINK_SPEED_MASK);
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
uint8_t RSLink_SpeedDecode(void)
{
return (RSLINK_SPEED_PIN)&RSLINK_SPEED_MASK;
}
uint8_t RSLink_AddrDecode(void)
{
return RSLINK_ADDR_PIN&RSLINK_ADDR_MASK;
}
#endif
#ifdef _SLAVE_EXT_
//-----------------------------------------------------------------------------
// DIP switch functions (FOR 328pb)
// This example is typical Idibus_Ext with shift register
//-----------------------------------------------------------------------------
void RSLink_DipsInit(void) // Dip switch Adders, Speed, Bus Type Init
{
// Clock, output -> 1
RSLINK_DIPS_CP_DDR |= (1 << RSLINK_DIPS_CP_BIT);
RSLINK_DIPS_CP_PORT |= (1 << RSLINK_DIPS_CP_BIT);
// Latch, output -> 1
RSLINK_DIPS_nPL_DDR |= (1 << RSLINK_DIPS_nPL_BIT);
RSLINK_DIPS_nPL_PORT |= (1 << RSLINK_DIPS_nPL_BIT);
// Data, input
RSLINK_DIPS_Q7_DDR &= ~(1 << RSLINK_DIPS_Q7_BIT);
RSLINK_DIPS_Q7_PORT &= ~(1 << RSLINK_DIPS_Q7_BIT);
}
//-----------------------------------------------------------------------------
static uint16_t RSLink_DipsRead(void) // Dip switch Adders, Speed, Bus Type Read
{
// RESULT = [ADDR7...0][XXXX][TYPE][SS2...0]
RSLINK_DIPS_nPL_PORT &= ~(1 << RSLINK_DIPS_nPL_BIT);
uint16_t STATE = 0;
RSLINK_DIPS_nPL_PORT |= (1 << RSLINK_DIPS_nPL_BIT);
for (uint8_t I = 0; I < 16; I++)
{
STATE = STATE << 1;
RSLINK_DIPS_CP_PORT &= ~(1 << RSLINK_DIPS_CP_BIT);
if ((RSLINK_DIPS_Q7_PIN & (1 << RSLINK_DIPS_Q7_BIT)) != 0)
{
STATE |= 0x0001;
}
RSLINK_DIPS_CP_PORT |= (1 << RSLINK_DIPS_CP_BIT);
}
return STATE & 0xFF0F;
}
//-----------------------------------------------------------------------------
uint8_t RSLink_SpeedDecode()
{
return (uint8_t)(RSLink_DipsRead() & 0x07);
}
uint8_t RSLink_AddrDecode()
{
return (uint8_t)(RSLink_DipsRead() >> 8);
}
#endif
#ifdef _CUSTOM_TYPE_
//Define custom type here
#endif

@ -0,0 +1,86 @@
/*
* File: idibus_hw.h
* Author: Michail
*
* Created on 20 ÿíâàðÿ 2026 ã., 16:12
*/
#ifndef IDIBUS_HW_H
#define IDIBUS_HW_H
#ifdef __cplusplus
extern "C" {
#endif
#include "config.h"
#include "avr/io.h"
//=============================================================================
// RSLINK SECTION
// Define specific macros for MCU
// Currently supports Ext with shift register and modules with address
// and speed on two different ports
//=============================================================================
//-----------------------------------------------------------------------------
// Status LED
//-----------------------------------------------------------------------------
#define RSLINK_LED_DDR DDRH
#define RSLINK_LED_PORT PORTH
#define RSLINK_LED_PIN PINH
#define RSLINK_LED_BIT 6
#ifdef _SLAVE_EXT_
//-----------------------------------------------------------------------------
// DIP switch - Address, Speed, Bus Type
//-----------------------------------------------------------------------------
#define RSLINK_DIPS_CP_PORT PORTD
#define RSLINK_DIPS_CP_DDR DDRD
#define RSLINK_DIPS_CP_PIN PIND
#define RSLINK_DIPS_CP_BIT 7
#define RSLINK_DIPS_nPL_PORT PORTD
#define RSLINK_DIPS_nPL_DDR DDRD
#define RSLINK_DIPS_nPL_PIN PIND
#define RSLINK_DIPS_nPL_BIT 6
#define RSLINK_DIPS_Q7_PORT PORTD
#define RSLINK_DIPS_Q7_DDR DDRD
#define RSLINK_DIPS_Q7_PIN PIND
#define RSLINK_DIPS_Q7_BIT 5
//------------------------------------------------------------------------------
#endif
#ifdef _SLAVE_MODULE_
//------------------------------------------------------------------------------
// Dip switch Adders, Speed, Bus Type
#define RSLINK_ADDR_DDR DDRA
#define RSLINK_ADDR_PORT PORTA
#define RSLINK_ADDR_PIN PINA
#define RSLINK_ADDR_MASK 0xFF
#define RSLINK_SPEED_DDR DDRL
#define RSLINK_SPEED_PORT PORTL
#define RSLINK_SPEED_PIN PINL
#define RSLINK_SPEED_MASK 0b111
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#endif
#ifdef _CUSTOM_TYPE_
//Define custom type here
#endif
void RSLink_DipsInit(void);
uint8_t RSLink_SpeedDecode(void);
uint8_t RSLink_AddrDecode(void);
//Reduces memory usage significally
#define RSLink_StatusLedSetOn() RSLINK_LED_PORT|=1<<RSLINK_LED_BIT
#define RSLink_StatusLedSetOff() RSLINK_LED_PORT&=~(1<<RSLINK_LED_BIT)
#define RSLink_StatusLedInit() RSLINK_LED_DDR|=1<<RSLINK_LED_BIT
#ifdef __cplusplus
}
#endif
#endif /* IDIBUS_HW_H */

@ -0,0 +1,81 @@
#include "config.h"
#include "System.h"
#include "boot.h"
#include "USART1.h"
#include "RSLink.h"
#include <avr/fuse.h>
#include <stdint.h>
#include "idibus_hw.h"
FUSES= { .extended=F_Ext, .high = F_High, .low = F_Low }; // Fuses + Lock programming
LOCKBITS=F_Lock;
int main(void)
{
cli();
// Not enough memory on 328pb
#ifdef _LONG_ADDR_SPACE_
//FUSE CHECK
asm volatile (
"ldi R31, 0x00 \n\t"
"ldi R30, 0x01 \n\t"
"ldi R16, 0x09 \n\t"
"out 0x37, R16 \n\t"
"lpm R17, Z \n\t"
"cpi R17, %0 \n\t"
"brne L_LOOP_%= \n\t"
// Fuse Extended
"ldi R30, 0x02 \n\t"
"out 0x37, R16 \n\t"
"lpm R17, Z \n\t"
"cpi R17, %1 \n\t"
"brne L_LOOP_%= \n\t"
// Fuse Low Byte
"ldi R30, 0x00 \n\t"
"out 0x37, R16 \n\t"
"lpm R17, Z \n\t"
"cpi R17, %2 \n\t"
"brne L_LOOP_%= \n\t"
// Fuse Hi Byte
"ldi R30, 0x03 \n\t"
"out 0x37, R16 \n\t"
"lpm R17, Z \n\t"
"cpi R17, %3 \n\t"
"breq L_EXIT_%= \n\t"
"L_LOOP_%=: \n\t"
"rjmp L_LOOP_%= \n\t"
"L_EXIT_%=: \n\t"
: //No output
: "M" (F_Lock),
"M" (F_Ext),
"M" (F_Low),
"M" (F_High)
);
#endif
wdt_enable(WDTO_2S);
wdt_reset();
//Move interrupt table
uint8_t temp = MCUCR;
MCUCR=temp|(1<<IVCE);
MCUCR=temp|(1<<IVSEL);
RSLink_StatusLedInit();
RSLink_StatusLedSetOn();
RSLink_DipsInit();
uint8_t Reason = FindBootloaderEnterReason(); //Do checks
wdt_reset();
//RSLink_StatusLedSetOff();
if (Reason == IDIFMW_REASON_NoReason) LaunchApplication();
USART1_Init();
RSLink_Init();
sei();
while (1)
{
RSLink_Handler();
wdt_reset();
}
}

@ -0,0 +1,240 @@
#include "bootFunctions.h"
#include "MEMORY.h"
#include "EEMEM.h"
#include "System.h"
#include "keys.c"
#include "idibus_hw.h"
void readDeviceData(flash_datablock_t* data, uint32_t addr) {
uint8_t* dst = (uint8_t*)data; // ????????? ?? ?????
uint32_t src = addr * 2; // ????? ?? flash (? ??????)
for (size_t i = 0; i < sizeof(flash_datablock_t); i++) {
dst[i] = pgm_read_byte_far(src + i);
}
}
static inline uint8_t CheckFirmware()
{
boot_rww_enable_safe();
uint32_t crcRead = flash_read_dword(STATIC_DATA_APP.AppCRC,0);
uint32_t crcCalc = CRC32(NULL,locationInApp<<1);
if (crcRead != crcCalc) return IDIFMW_REASON_NoFmwDetected;
return 0;
}
static inline uint8_t CheckEEPROMFlag()
{
eeprom_busy_wait();
uint8_t flag = eeprom_read_byte(&(EEBLOCK.BOOTFLAG));
if (flag != 0xFF)
{
//clear it
eeprom_busy_wait();
eeprom_write_byte(&(EEBLOCK.BOOTFLAG),0xFF);
eeprom_busy_wait();
return IDIFMW_REASON_EnterFromApplication;
}
else return 0;
}
static inline uint8_t CheckADDR()
{
uint8_t RS_Address = RSLink_AddrDecode();
if (RS_Address == IDIBUS_DEVELOPER_ADDR_3) return IDIFMW_REASON_EnterForced;
return 0;
}
uint8_t FindBootloaderEnterReason()
{
uint8_t Reason = 0;
Reason |= IDIFMW_REASON_NoReason;
Reason |= CheckFirmware();
Reason |= CheckEEPROMFlag();
Reason |= CheckADDR();
return Reason;
}
static FMW_INFO FmwInfo;
static volatile uint32_t BlockNumber;
static uint8_t update_in_procces = 0;
static uint8_t AES_DISABLED=1;
uint8_t BootloaderUpdateInit(FMW_INFO new_FmwInfo)
{
AES_PrepareKeys(key,IV);
AES_DISABLED = 1; // Disable AES
update_in_procces = 0;
BlockNumber = 0;
FmwInfo = new_FmwInfo;
//At this moment let's think that it's not ENCRYPTED
// Check CRC32
uint32_t calculatedCRC = CRC32((uint8_t*)&FmwInfo,sizeof(FmwInfo)-CRC32_SIZE);
if (calculatedCRC != FmwInfo.InfoHash)
{
//Seems like it's either non ENCRYPTED or damaged
//Decrypt it and try again
AES_Decrypt((uint8_t*)&FmwInfo,sizeof(FmwInfo));
calculatedCRC = CRC32((uint8_t*)&FmwInfo,sizeof(FmwInfo)-CRC32_SIZE);
//Check CRC again
if (calculatedCRC != FmwInfo.InfoHash) return 1; // Bad. No need to continue
//Otherwise enable AES
AES_DISABLED = 0;
}
uint8_t Check = 0;
if (FmwInfo.FmwSizeInPages >= PAGE_COUNT)
{
Check = 2;
return Check;
}
for (uint8_t i = 0; i < IDISN_FIXP_MODULE_TYPE_Length; i++)
{
if (flash_read_byte(STATIC_DATA_BL.ModuleType,i) != FmwInfo.ModuleType[i]){
Check = 3;
return Check;
}
}
for (uint8_t i = 0; i < IDISN_FIXP_HW_REV_Length; i++)
{
if (flash_read_byte(STATIC_DATA_BL.HW_revision,i) != FmwInfo.HwRevision[i])
{
Check = 4;
return Check;
}
}
//Erase all flash in APP
for (uint32_t page = 0; page < PAGE_COUNT; page++)
{
boot_spm_busy_wait();
boot_page_erase((page)*SPM_PAGESIZE);
wdt_reset();
}
if (Check == 0) update_in_procces = 1;
return Check;
}
uint8_t BootloaderUpdateHandler(uint8_t* chunk)
{
if (update_in_procces == 0) return 1;
if (AES_DISABLED == 0) AES_Decrypt(chunk, SPM_PAGESIZE); //
uint_farptr_t page_start = (uint32_t)BlockNumber * SPM_PAGESIZE;
boot_spm_busy_wait();
for (uint16_t counter = 0; counter < SPM_PAGESIZE; counter += 2)
{
uint16_t word = *((uint16_t*)&chunk[counter]);
boot_page_fill(page_start + counter, word);
}
boot_spm_busy_wait();
boot_page_write(page_start);
boot_spm_busy_wait();
BlockNumber++;
return 0;
}
static inline void updateAppData()
{
volatile flash_datablock_t newDataApp;
readDeviceData(&newDataApp, locationInBoot);
newDataApp.SW[0] = FmwInfo.SwVersion[0];
newDataApp.SW[1] = FmwInfo.SwVersion[1];
newDataApp.AppCRC = FmwInfo.FmwHash;
uint8_t *ptr = (uint8_t*)&newDataApp;
const uint32_t baseAddr = locationInApp * 2;
boot_spm_busy_wait();
for ( uint32_t Addr = baseAddr;Addr<baseAddr+SPM_PAGESIZE;Addr+=2)
{
if (Addr < baseAddr+sizeof(newDataApp))
{
uint16_t word = 0;
word |= *ptr;
ptr++;
word |= (((uint16_t)*ptr) << 8);
ptr++;
boot_page_fill(Addr,word);
}
else
{
boot_page_fill(Addr,0xFFFF);
}
wdt_reset();
}
boot_spm_busy_wait();
boot_page_write(baseAddr);
boot_spm_busy_wait();
}
uint8_t BootloaderUpdateEnd()
{
if (update_in_procces == 0) return 1;
//Last block
/*Write personal info*/
wdt_reset();
boot_spm_busy_wait();
boot_rww_enable();
updateAppData();
update_in_procces = 0;
if (CheckFirmware() == 0)
{
// No errors
return 0;
}
else
{
//CRC Fail
return 1;
}
}
void LaunchApplication()
{
MCUCR=(1<<IVCE);
MCUCR=(0<<IVSEL);
boot_rww_enable_safe(); // enable application section
asm volatile(
//Clear SRAM
//Should work needs testing
"clr r28 \n\t"
"LDI r30, %0 \n\t"
"LDI r31, %1 \n\t"
"CLEAR_%=: \n\t"
"adiw r30, 1 \n\t"
"st Z, r28 \n\t"
"cpi r30, %2 \n\t"
"ldi r29, %3 \n\t"
"cpc r31, r29 \n\t"
"BRNE CLEAR_%= \n\t"
//Jmp to app
"clr r30 \n\t"
"clr r31 \n\t"
"ijmp \n\t"
://No output
:"M" (RAMSTART&0xFF), "M" (RAMSTART>>8), "M" (RAMEND&0xFF), "M" (RAMEND>>8));
while(1);
}

@ -0,0 +1,35 @@
#ifndef BOOTFUNCTIONS_H_
#define BOOTFUNCTIONS_H_
#include <inttypes.h>
#include "config.h"
#include "boot.h"
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <avr/eeprom.h>
#include <avr/boot.h>
#include <avr/wdt.h>
#include "System.h"
#include "RSLink.h"
#include "AES.h"
#include "boot.h"
#include "MEMORY.h"
//FLAG FIELD
#define IDIFMW_REASON_NoReason (1<<0)
#define IDIFMW_REASON_EnterFromApplication (1<<1) //EEPROM FLAG
#define IDIFMW_REASON_EnterForced (1<<2) //Address detection
#define IDIFMW_REASON_NoFmwDetected (1<<3)
uint8_t FindBootloaderEnterReason();
uint8_t BootloaderUpdateInit(FMW_INFO new_FmwInfo);
uint8_t BootloaderUpdateEnd();
uint8_t BootloaderUpdateHandler();
void readDeviceData(flash_datablock_t* data, uint32_t addr);
void LaunchApplication();
#endif /* BOOTFUNCTIONS_H_ */

@ -0,0 +1,461 @@
//#############################################################################################################################################################################################################
#ifndef _INC_IDIBUS_DEFS_H_
#define _INC_IDIBUS_DEFS_H_
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#include <inttypes.h>
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#define F_CPU 16000000UL
#define MODBUS_CRC16_SIZE sizeof(uint16_t)
#define CRC32_SIZE sizeof(uint32_t)
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#define IDIBUS_BAUDRATE_DSW_CODE_19200B 0x00
#define IDIBUS_BAUDRATE_DSW_CODE_500K 0x01
#define IDIBUS_BAUDRATE_DSW_CODE_2400B 0x02
#define IDIBUS_BAUDRATE_DSW_CODE_9600B 0x03
#define IDIBUS_BAUDRATE_DSW_CODE_115200B 0x04
#define IDIBUS_BAUDRATE_DSW_CODE_250K 0x05
#define IDIBUS_BAUDRATE_DSW_CODE_1M 0x06
#define IDIBUS_BAUDRATE_DSW_CODE_10M 0x07
// Full timeout will be (InterframeTimeout + ResponseTimeout) for request(Write + Read) or InterframeTimeout for write(Write only)
#define IDIBUS_2400B_INTERFRAME_TIMEOUT_US 16042ULL //11 * 3.5 / Baudrate
#define IDIBUS_9600B_INTERFRAME_TIMEOUT_US 4011ULL
#define IDIBUS_19200B_INTERFRAME_TIMEOUT_US 2006ULL
#define IDIBUS_115200B_INTERFRAME_TIMEOUT_US 1750ULL
#define IDIBUS_250K_INTERFRAME_TIMEOUT_US 1750ULL
#define IDIBUS_500K_INTERFRAME_TIMEOUT_US 1750ULL
#define IDIBUS_1M_INTERFRAME_TIMEOUT_US 1750ULL
#define IDIBUS_10M_INTERFRAME_TIMEOUT_US 1750ULL
#define IDIBUS_2400B_ALARM_TIMEOUT_US 34375ULL //11 * 3.5 / Baudrate
#define IDIBUS_9600B_ALARM_TIMEOUT_US 8594ULL
#define IDIBUS_19200B_ALARM_TIMEOUT_US 4297ULL
#define IDIBUS_115200B_ALARM_TIMEOUT_US 1750ULL
#define IDIBUS_250K_ALARM_TIMEOUT_US 1750ULL
#define IDIBUS_500K_ALARM_TIMEOUT_US 1750ULL
#define IDIBUS_1M_ALARM_TIMEOUT_US 1750ULL
#define IDIBUS_10M_ALARM_TIMEOUT_US 1750ULL
#define IDIBUS_2400B_MASTER_RESPONSE_TIMEOUT_US (IDIBUS_2400B_INTERFRAME_TIMEOUT_US * 3 / 2 )
#define IDIBUS_9600B_MASTER_RESPONSE_TIMEOUT_US (IDIBUS_9600B_INTERFRAME_TIMEOUT_US * 3 / 2 )
#define IDIBUS_19200B_MASTER_RESPONSE_TIMEOUT_US (IDIBUS_19200B_INTERFRAME_TIMEOUT_US * 3 / 2 )
#define IDIBUS_115200B_MASTER_RESPONSE_TIMEOUT_US (IDIBUS_115200B_INTERFRAME_TIMEOUT_US * 3 / 2 )
#define IDIBUS_250K_MASTER_RESPONSE_TIMEOUT_US (IDIBUS_250K_INTERFRAME_TIMEOUT_US * 3 / 2 )
#define IDIBUS_500K_MASTER_RESPONSE_TIMEOUT_US (IDIBUS_500K_INTERFRAME_TIMEOUT_US * 3 / 2 )
#define IDIBUS_1M_MASTER_RESPONSE_TIMEOUT_US (IDIBUS_1M_INTERFRAME_TIMEOUT_US * 3 / 2 )
#define IDIBUS_10M_MASTER_RESPONSE_TIMEOUT_US (IDIBUS_10M_INTERFRAME_TIMEOUT_US * 3 / 2 )
#define IDIBUS_2400B_SLAVE_RESPONSE_TIMEOUT_US (IDIBUS_2400B_INTERFRAME_TIMEOUT_US )
#define IDIBUS_9600B_SLAVE_RESPONSE_TIMEOUT_US (IDIBUS_9600B_INTERFRAME_TIMEOUT_US )
#define IDIBUS_19200B_SLAVE_RESPONSE_TIMEOUT_US (IDIBUS_19200B_INTERFRAME_TIMEOUT_US )
#define IDIBUS_115200B_SLAVE_RESPONSE_TIMEOUT_US (IDIBUS_115200B_INTERFRAME_TIMEOUT_US)
#define IDIBUS_250K_SLAVE_RESPONSE_TIMEOUT_US (IDIBUS_250K_INTERFRAME_TIMEOUT_US )
#define IDIBUS_500K_SLAVE_RESPONSE_TIMEOUT_US (IDIBUS_500K_INTERFRAME_TIMEOUT_US )
#define IDIBUS_1M_SLAVE_RESPONSE_TIMEOUT_US (IDIBUS_1M_INTERFRAME_TIMEOUT_US )
#define IDIBUS_10M_SLAVE_RESPONSE_TIMEOUT_US (IDIBUS_10M_INTERFRAME_TIMEOUT_US )
enum IDIBUS_SERIAL_BAUDRATE {
IDIBUS_BAUDRATE_2400 = IDIBUS_BAUDRATE_DSW_CODE_2400B,
IDIBUS_BAUDRATE_9600 = IDIBUS_BAUDRATE_DSW_CODE_9600B,
IDIBUS_BAUDRATE_19200 = IDIBUS_BAUDRATE_DSW_CODE_19200B,
IDIBUS_BAUDRATE_115200 = IDIBUS_BAUDRATE_DSW_CODE_115200B,
IDIBUS_BAUDRATE_250K = IDIBUS_BAUDRATE_DSW_CODE_250K,
IDIBUS_BAUDRATE_500K = IDIBUS_BAUDRATE_DSW_CODE_500K,
IDIBUS_BAUDRATE_1M = IDIBUS_BAUDRATE_DSW_CODE_1M,
IDIBUS_BAUDRATE_10M = IDIBUS_BAUDRATE_DSW_CODE_10M
};
#define IDIBUS_LINK_LED_NO_MMES_TIMEOUT_0_SEC 60U
#define IDIBUS_LINK_LED_NO_MMES_TIMEOUT_0_MS ( IDIBUS_LINK_LED_NO_MMES_TIMEOUT_0_SEC * 1000U )
#define IDIBUS_LINK_LED_NO_MMES_TIMEOUT_1_SEC 15U
#define IDIBUS_LINK_LED_NO_MMES_TIMEOUT_1_MS ( IDIBUS_LINK_LED_NO_MMES_TIMEOUT_1_SEC * 1000U )
enum IDIBUS_RXTIMER_TIMEOUT_MODE {
IDIBUS_TIMER_MODE_RX_TIMEOUT = 0x00,
IDIBUS_TIMER_MODE_ALARM_TIMEOUT,
IDIBUS_TIMER_MODE_RESPONSE_TIMEOUT
};
//=============================================================================================================================================================================================================
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//=============================================================================================================================================================================================================
#define IDISN_FIXP_Pos 1U //Internal padding
#define IDISN_FIXP_GS1_COUNTRY_Pos ( IDISN_FIXP_Pos + 0U)
#define IDISN_FIXP_GS1_COUNTRY_Length 3
#define IDISN_FIXP_GS1_COMPANY_Pos ( IDISN_FIXP_GS1_COUNTRY_Pos + IDISN_FIXP_GS1_COUNTRY_Length )
#define IDISN_FIXP_GS1_COMPANY_Length 6
#define IDISN_FIXP_MODULE_TYPE_Pos ( IDISN_FIXP_GS1_COMPANY_Pos + IDISN_FIXP_GS1_COMPANY_Length )
#define IDISN_FIXP_MODULE_TYPE_Length 3
#define IDISN_FIXP_HW_REV_Pos ( IDISN_FIXP_MODULE_TYPE_Pos + IDISN_FIXP_MODULE_TYPE_Length )
#define IDISN_FIXP_HW_REV_Length 2
#define IDISN_FIXP_SERIAL_Pos ( IDISN_FIXP_HW_REV_Pos + IDISN_FIXP_HW_REV_Length )
#define IDISN_FIXP_SERIAL_Length 7
#define IDISN_FIXP_MAC_Pos ( IDISN_FIXP_SERIAL_Pos + IDISN_FIXP_SERIAL_Length )
#define IDISN_FIXP_MAC_Length 6
#define IDISN_FIXP_SW_REV_Pos ( IDISN_FIXP_MAC_Pos + IDISN_FIXP_MAC_Length )
#define IDISN_FIXP_SW_REV_Length 2
#define IDISN_FIXP_LENGTH ( IDISN_FIXP_GS1_COUNTRY_Length + IDISN_FIXP_GS1_COMPANY_Length + IDISN_FIXP_MODULE_TYPE_Length + \
IDISN_FIXP_HW_REV_Length + IDISN_FIXP_SERIAL_Length + IDISN_FIXP_MAC_Length + IDISN_FIXP_SW_REV_Length )
#define IDISN_VARP_Pos 0 //IDISN_FIXP_LENGTH
#define IDISN_VARP_VERIF_DATE_Pos ( IDISN_VARP_Pos )
#define IDISN_VARP_VERIF_DATE_Length 4U
#define IDISN_VARP_EXPIR_DATE_Pos ( IDISN_VARP_VERIF_DATE_Pos + IDISN_VARP_VERIF_DATE_Length )
#define IDISN_VARP_EXPIR_DATE_Length 4U
#define IDISN_VARP_IPv4_Pos ( IDISN_VARP_EXPIR_DATE_Pos + IDISN_VARP_EXPIR_DATE_Length )
#define IDISN_VARP_IPv4_Length 4U
#define IDISN_VARP_IPv6_Pos ( IDISN_VARP_IPv4_Pos + IDISN_VARP_IPv4_Length )
#define IDISN_VARP_IPv6_Length 16U
#define IDISN_VARP_AES256_Pos ( IDISN_VARP_IPv6_Pos + IDISN_VARP_IPv6_Length )
#define IDISN_VARP_AES256_Length 32U
#define IDISN_VARP_LENGTH ( IDISN_VARP_VERIF_DATE_Length + IDISN_VARP_EXPIR_DATE_Length + \
IDISN_VARP_IPv4_Length + IDISN_VARP_IPv6_Length + IDISN_VARP_AES256_Length )
#define IDISN_FULL_LENGTH ( IDISN_FIXP_LENGTH + IDISN_VARP_LENGTH )
//=============================================================================================================================================================================================================
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//=============================================================================================================================================================================================================
#define ISIBUS_MASTER_MAIN_ADDR 255U
#define ISIBUS_MASTER_SPARE_ADDR 254U
#define IDIBUS_SLAVE_ADDR_MIN 1U
#define IDIBUS_SLAVE_ADDR_MAX 229U
#define IDIBUS_DEVELOPER_ADDR_0 250U
#define IDIBUS_DEVELOPER_ADDR_1 251U
#define IDIBUS_DEVELOPER_ADDR_2 252U
#define IDIBUS_DEVELOPER_ADDR_3 253U
#define IDIBUS_GROUP_0_ADDR 230U
#define IDIBUS_GROUP_1_ADDR 231U
#define IDIBUS_GROUP_2_ADDR 232U
#define IDIBUS_GROUP_3_ADDR 233U
#define IDIBUS_GROUP_4_ADDR 234U
#define IDIBUS_GROUP_5_ADDR 235U
#define IDIBUS_GROUP_6_ADDR 236U
#define IDIBUS_GROUP_7_ADDR 237U
#define IDIBUS_GROUP_8_ADDR 238U
#define IDIBUS_GROUP_9_ADDR 239U
#define IDIBUS_GROUP_10_ADDR 240U
#define IDIBUS_GROUP_11_ADDR 241U
#define IDIBUS_GROUP_12_ADDR 242U
#define IDIBUS_GROUP_13_ADDR 243U
#define IDIBUS_GROUP_14_ADDR 244U
#define IDIBUS_GROUP_15_ADDR 245U
#define IDIBUS_GROUPS_NUMBER 16U
#define IDIBUS_GROUP_FIRST_NUMBER 0U
#define IDIBUS_GROUP_LAST_NUMBER 15U
//=============================================================================================================================================================================================================
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//=============================================================================================================================================================================================================
#define IDIMMES_ADDR_Pos 00U
#define IDIMMES_MMPS_Pos 01U
#define IDIMMES_MMPS_LONG_MES_Pos 0U
#define IDIMMES_MMPS_LONG_MES_Msk 0x01U
#define IDIMMES_MMPS_MES_TYPE_Pos 1U
#define IDIMMES_MMPS_MES_TYPE_Msk 0x02U
#define IDIMMES_MMPS_MES_TYPE_MMES 0x00U
#define IDIMMES_MMPS_MES_TYPE_MMESG 0x01U
#define IDIMMES_MMPS_FAST_FUNC_Pos 2U
#define IDIMMES_MMPS_FAST_FUNC_Msk 0x3CU
#define IDIMMES_MMPS_ALARM_FRAME_Pos 6U
#define IDIMMES_MMPS_ALARM_FRAME_Msk 0x40U
#define IDIMMES_MMPS_ENCRYPTED_AES_Pos 7U
#define IDIMMES_MMPS_ENCRYPTED_AES_Msk 0x80U
#define IDIMMES_DEV_Pos 02U
#define IDIMMES_DEV_NUM_Pos 0U
#define IDIMMES_DEV_NUM_Msk 0x1FU
#define IDIMMES_DEV_ALLCH_Pos 5U
#define IDIMMES_DEV_ALLCH_Msk 0x20U
#define IDIMMES_CHNL_Pos 03U
#define IDIMMES_CHNL_NUM_Pos 0U
#define IDIMMES_CHNL_NUM_Msk 0x7FU
#define IDIMMES_CHNL_ALLSAME_Pos 7U
#define IDIMMES_CHNL_ALLSAME_Msk 0x80U
#define IDIMMES_DATA_FUNC_COM_DATA_Pos 04U
#define IDIMMES_MAX_HEADER_LENGTH (IDIMMES_DATA_FUNC_COM_DATA_Pos + 1)
#define IDIMMES_MAX_DATA_SIZE 256U
#define IDIMMES_MAX_MES_SIZE (IDIMMES_MAX_DATA_SIZE + IDIMMES_MAX_HEADER_LENGTH + MODBUS_CRC16_SIZE)
#define IDIMMES_MIN_MES_SIZE (IDIMMES_DATA_FUNC_COM_DATA_Pos + MODBUS_CRC16_SIZE)
#define IDIMMESG_DATA_COM_FUNC_Pos 02U
#define IDIMMESG_MAX_HEADER_LENGTH (IDIMMESG_DATA_COM_FUNC_Pos + 1)
#define IDIMMESG_MAX_DATA_SIZE IDIMMES_MAX_DATA_SIZE
#define IDIMMESG_MAX_MES_SIZE (IDIMMESG_MAX_DATA_SIZE + IDIMMESG_MAX_HEADER_LENGTH + MODBUS_CRC16_SIZE)
#define IDIMMESG_MODULE_MIN_MES_SIZE (IDIMMESG_DATA_COM_FUNC_Pos + 1 + MODBUS_CRC16_SIZE)
#define IDIMMESG_GROUP_MIN_MES_SIZE (IDIMMESG_DATA_COM_FUNC_Pos + MODBUS_CRC16_SIZE)
#define IDIMMES_LMES_MSIZE_Pos 0U
#define IDIMMES_LMES_BSIZE_Pos (IDIMMES_LMES_MSIZE_Pos + 4U)
#define IDIMMES_LMES_IDENTIFIER_LENGTH (IDIMMES_LMES_BSIZE_Pos + 1U)
#define IDIMMES_LMES_BSIZE_256B 0U
#define IDIMMES_LMES_BSIZE_1K 1U
#define IDIMMES_LMES_BSIZE_4K 2U
#define IDIMMES_LMES_BSIZE_8K 3U
#define IDIMMES_LMES_BSIZE_16K 4U
#define IDIMMES_LMES_BSIZE_32K 5U
//=============================================================================================================================================================================================================
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//=============================================================================================================================================================================================================
#define IDISMES_ADDR_Pos 00U
#define IDISMES_SMPS_Pos 01U
#define IDISMES_SMPS_ERROR_BIT_Pos 0U
#define IDISMES_SMPS_LONG_MES_Pos 1U
#define IDISMES_SMPS_LONG_OP_Pos 2U
#define IDISMES_ERROR_Pos 02U
#define IDISMES_DATA_Pos 03U
#define IDISMES_MAX_DATA_SIZE 256U
#define IDISMES_MIN_MES_SIZE (IDISMES_DATA_Pos + MODBUS_CRC16_SIZE)
#define IDISMES_MAX_MES_SIZE (IDISMES_DATA_Pos + IDISMES_MAX_DATA_SIZE + MODBUS_CRC16_SIZE)
//=============================================================================================================================================================================================================
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//=============================================================================================================================================================================================================
#define IDILONGOP_STATE_COMPLETE_NO_ERR 0x00U
#define IDILONGOP_STATE_IN_PROC 0x01U
#define IDILONGOP_STATE_COMPLETE_WITH_ERR 0x02U
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#define IDILONGOP_MES_DATA_LENGTH 5U
#define IDILONGOP_STATE_Pos 0U
#define IDILONGOP_REMAIN_TIME_Pos 1U
//=============================================================================================================================================================================================================
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//=============================================================================================================================================================================================================
#define IDISTATUS_B0S_Pos 00U
#define IDISTATUS_B0S_ST_ERROR_Pos 0U
#define IDISTATUS_B0S_ST_STATE_Pos 1U
#define IDISTATUS_B0S_ST_STATE_Msk 0x07U
#define IDISTATUS_B0S_ST_STATE_StNoInit 0x00U
#define IDISTATUS_B0S_ST_STATE_StOperate 0x01U
#define IDISTATUS_B0S_ST_STATE_StFreeze 0x02U
#define IDISTATUS_B0S_ST_STATE_StVirtual 0x03U
#define IDISTATUS_B0S_ST_STATE_StFirmwareUpd 0x04U
#define IDISTATUS_B0S_ST_STATE_StReservedMaster 0x05U
#define IDISTATUS_B0S_ST_STATE_StBroken 0x06U
#define IDISTATUS_B0S_ST_STATE_StReserved0 0x07U
#define IDISTATUS_B0S_AES_SUPPORTED_Pos 4U
#define IDISTATUS_B0S_AES_INSTALLED_Pos 5U
#define IDISTATUS_B0S_SEND_ALARM_L0_Pos 6U
#define IDISTATUS_B0S_SEND_ALARM_L1_Pos 7U
#define IDISTATUS_B1S_Pos 01U
#define IDISTATUS_B1S_MODULE_TYPE_Pos 0U
#define IDISTATUS_B1S_MODULE_TYPE_Msk 0x03U
#define IDISTATUS_B1S_MODULE_TYPE_Master 0x00U
#define IDISTATUS_B1S_MODULE_TYPE_SpareMaster 0x01U
#define IDISTATUS_B1S_MODULE_TYPE_Slave 0x02U
#define IDISTATUS_B1S_MODULE_TYPE_Bridge 0x03U
#define IDISTATUS_B1S_BRIDGE_CONNECTED_Pos 2U
#define IDISTATUS_B1S_SELF_INIT_Pos 3U
#define IDISTATUS_B1S_TIMEOUT_LED_Pos 4U
#define IDISTATUS_B1S_NO_MMES_TIMEOUT_Pos 5U
#define IDISTATUS_B1S_CATCH_ALARM_L0_Pos 6U
#define IDISTATUS_B1S_CATCH_ALARM_L1_Pos 7U
#define IDISTATUS_SN_Pos 02U
#define IDISTATUS_LENGTH ( IDISTATUS_SN_Pos + IDISN_FULL_LENGTH )
//=============================================================================================================================================================================================================
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//=============================================================================================================================================================================================================
#define IDIMMES_NOT_FAST_FUNC 0U
#define IDIMMES_MAX_FAST_FUNC_NUM 15U
#define IDIMMES_COM_START_NUM 220U
#define IDIMMES_COM_C_Init 220U
#define IDIMMES_COM_C_ShtDown 221U
#define IDIMMES_COM_C_Freeze 222U
#define IDIMMES_COM_C_Resume 223U
#define IDIMMES_COM_C_Dummy 224U
#define IDIMMES_COM_C_AssignGroup 225U
#define IDIMMES_COM_C_SetAlarmL12 226U
#define IDIMMES_COM_C_SetAlarmL 227U
#define IDIMMES_COM_C_Virtual 228U
#define IDIMMES_COM_C_SyncReadChnl 229U
#define IDIMMES_COM_C_SyncRead 230U
#define IDIMMES_COM_C_SyncDoChnl 231U
#define IDIMMES_COM_C_SyncDo 232U
#define IDIMMES_COM_C_SyncClear 233U
#define IDIMMES_COM_C_BurstReadCnt 234U
#define IDIMMES_COM_C_BurstReadTime 235U
#define IDIMMES_COM_C_SendTimeDate 236U
#define IDIMMES_COM_C_MkTimedMaster 237U
#define IDIMMES_COM_C_EnterBootloader 238U
#define IDIMMES_COM_C_RESERVE_0 239U
#define IDIMMES_COM_C_RESERVE_1 240U
#define IDIMMES_COM_C_ReadDevFullSN_MS 241U
#define IDIMMES_COM_C_WriteSnIPv4IPv6 242U
#define IDIMMES_COM_C_WriteSnVerifyDates 243U
#define IDIMMES_COM_C_WriteSnAES256 244U
#define IDIMMES_COM_C_SendLongMessage 245U
#define IDIMMES_COM_C_GetLondMessage 246U
#define IDIMMES_COM_C_DummyModule 247U
#define IDIMMES_COM_C_CheckModuleLongOp 248U
#define IDIMMES_COM_C_CheckChannelLongOp 249U
#define IDIMMES_COM_C_FmwBootloaderInfo 250U //Ask for bootloader version
#define IDIMMES_COM_C_FmwBootloaderStart 251U //Start upload and recieve fwinfo
#define IDIMMES_COM_C_FmwBootloaderWrite 252U //Write chunk
#define IDIMMES_COM_C_FmwBootloaderEnd 253U //upload end. Finish operations and reboot
#define IDIMMES_COM_C_GotoApp 254U //Jump to application
//=============================================================================================================================================================================================================
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//=============================================================================================================================================================================================================
#define IDIER_MODBUS_NUM_START 1U
#define IDIER_MODBUS_NUM_END 9U
#define IDIER_MODULE_MASTER_NUM_START 10U
#define IDIER_MODULE_MASTER_NUM_END 32U
#define IDIER_MODULE_SLAVE_NUM_START 33U
#define IDIER_MODULE_SLAVE_NUM_END 71U
#define IDIER_MODULE_NUM_START IDIER_MODULE_MASTER_NUM_START
#define IDIER_MODULE_NUM_END IDIER_MODULE_SLAVE_NUM_END
#define IDIER_DEVICE_NUM_START 72U
#define IDIER_DEVICE_NUM_END 89U
#define IDIER_NOPE 0U
#define MODBUSER_WRONGFUNC 1U
#define MODBUSER_WRONGADDR 2U
#define MODBUSER_WRONGDATA 3U
#define MODBUSER_BROKE 4U
#define MODBUSER_LONGCOMMAND 5U
#define MODBUSER_BUSY 6U
#define MODBUSER_CANTDOFUNC 7U
#define MODBUSER_EXTMEMORYERROR 8U
#define MODBUSER_RESERVED 9U
#define IDIERMST_INVALID_ADDR_NUM 10U
#define IDIERMST_INVALID_DEV_NUM 11U
#define IDIERMST_INVALID_CHN_NUM 12U
#define IDIERMST_INVALID_FUNC_NUM 13U
#define IDIERMST_INVALID_TX_REQUEST_FORMAT 14U
#define IDIERMST_INVALID_TX_PARAM 15U
#define IDIERMST_TX_MES 16U
#define IDIERMST_RCV_TIMEOUT 17U
#define IDIERMST_MES_RX_INTEGRITY 18U
#define IDIERMST_CRC 19U
#define IDIERMST_MULTIPLE_CRC 20U
#define IDIERMST_INVALID_RX_REQUEST_FORMAT 21U
#define IDIERMST_INVALID_RX_PARAM 22U
#define IDIERMST_RESEVED_23 23U
#define IDIERMST_RESEVED_24 24U
#define IDIERMST_RESEVED_25 25U
#define IDIERMST_RESEVED_26 26U
#define IDIERMST_RESEVED_27 27U
#define IDIERMST_EXTRA_28 28U
#define IDIERMST_EXTRA_29 29U
#define IDIERMST_EXTRA_30 30U
#define IDIERMST_EXTRA_31 31U
#define IDIERMST_EXTRA_32 32U
#define IDIERSLV_RESEVED_33 33U
#define IDIERSLV_ENCRYPTION_NOT_SUPPORTED 34U
#define IDIERSLV_ENCRYPTION_NOT_INSTALLED 35U
#define IDIERSLV_JUMBO_NOT_SUPPORTED 36U
#define IDIERSLV_UNSUPPORTED_FUNC_NUM 37U
#define IDIERSLV_INVALID_RX_REQUEST_FORMAT 38U
#define IDIERSLV_INVALID_RX_PARAM 39U
#define IDIERSLV_IN_FREEZE 40U
#define IDIERSLV_RESERVED_41 41U
#define IDIERSLV_RESERVED_42 42U
#define IDIERSLV_RESERVED_43 43U
#define IDIERSLV_RESERVED_44 44U
#define IDIERSLV_RESERVED_45 45U
#define IDIERSLV_EXTRA_46 46U
#define IDIERSLV_EXTRA_47 47U
#define IDIERSLV_EXTRA_48 48U
#define IDIERSLV_EXTRA_49 49U
#define IDIERSLV_EXTRA_50 50U
#define IDIERSLV_BROKE 51U
#define IDIERSLV_NO_FIRMWARE 52U
#define IDIERSLV_NO_INIT 53U
#define IDIERSLV_OVERHEAT 54U
#define IDIERSLV_INP_VOLTAGE 55U
#define IDIERSLV_BRIDGE_OVERFLOW 56U
#define IDIERSLV_BRIDGE_NOT_CONF 57U
#define IDIERSLV_VERIF_DATE 58U
#define IDIERSLV_RTC 59U
#define IDIERSLV_LONG_OP_IN_PROC 60U
#define IDIERSLV_RESERVED_61 61U
#define IDIERSLV_RESERVED_62 62U
#define IDIERSLV_RESERVED_63 63U
#define IDIERSLV_RESERVED_64 64U
#define IDIERSLV_RESERVED_65 65U
#define IDIERSLV_RESERVED_66 66U
#define IDIERSLV_EXTRA_67 67U
#define IDIERSLV_EXTRA_68 68U
#define IDIERSLV_EXTRA_69 69U
#define IDIERSLV_EXTRA_70 70U
#define IDIERSLV_EXTRA_71 71U
#define IDIERDEV_INVALID_DEV_NUM 72U
#define IDIERDEV_INVALID_CHN_NUM 73U
#define IDIERDEV_INVALID_FUNC_NUM 74U
#define IDIERDEV_LONG_OP_IN_PROC 75U
#define IDIERDEV_RESERVED_76 76U
#define IDIERDEV_PARAM_LOW_ST_TIMEOUT 77U
#define IDIERDEV_PARAM_HIGH_ST_TIMEOUT 78U
#define IDIERDEV_PARAM_NOT_CHANGE_TIMEOUT 79U
#define IDIERDEV_RESERVED_80 80U
#define IDIERDEV_RESERVED_81 81U
#define IDIERDEV_RESERVED_82 82U
#define IDIERDEV_RESERVED_83 83U
#define IDIERDEV_RESERVED_84 84U
#define IDIERDEV_RESERVED_85 85U
#define IDIERDEV_RESERVED_86 86U
#define IDIERDEV_RESERVED_87 87U
#define IDIERDEV_RESERVED_88 88U
#define IDIERDEV_RESERVED_89 89U
#define IDIER_MULTIPLE_CRC_AVRBUF_SIZE 16U
#define IDIER_MULTIPLE_CRC_AVRBUF_THR 5U
//=============================================================================================================================================================================================================
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//=============================================================================================================================================================================================================
#define IDIDATE_FORMAT_DAY_Pos 0U
#define IDIDATE_FORMAT_MONTH_Pos 1U
#define IDIDATE_FORMAT_CENTURY_Pos 2U
#define IDIDATE_FORMAT_YEAR99_Pos 3U
#define IDIDATE_FORMAT_LENGTH 4U
#define IDITIME_FORMAT_SECONDS_Pos 0U
#define IDITIME_FORMAT_MINUTES_Pos 1U
#define IDITIME_FORMAT_HOURS_Pos 2U
#define IDITIME_FORMAT_TIMEZONE_Pos 3U
#define IDITIME_FORMAT_LENGTH 4U
#define IDITIME_FORMAT_TIMEZONE_MIN (-12)
#define IDITIME_FORMAT_TIMEZONE_MAX 14
#define IDIMMES_C_DATETIME_TIME_Pos 0
#define IDIMMES_C_DATETIME_DATE_Pos (IDIMMES_C_DATETIME_TIME_Pos + IDIDATE_FORMAT_LENGTH)
#define IDIMMES_C_DATETIME_LENGTH (IDIDATE_FORMAT_LENGTH + IDITIME_FORMAT_LENGTH)
//=============================================================================================================================================================================================================
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//=============================================================================================================================================================================================================
typedef struct {
struct {
uint8_t StError : 1;
uint8_t StState : 3;
uint8_t AesSupported : 1;
uint8_t AesInstalled : 1;
uint8_t SendAlarmL0 : 1;
uint8_t SendAlarmL1 : 1;
} B0S;
struct {
uint8_t ModuleType : 2;
uint8_t BridgeConnected : 1;
uint8_t SelfInit : 1;
uint8_t TimeoutLed : 1;
uint8_t NoMMESTimeout : 1;
uint8_t CatchAlarmL0 : 1;
uint8_t CatchAlarmL1 : 1;
} B1S;
} IDISTATUS_STATE_TYPE;
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
typedef struct {
IDISTATUS_STATE_TYPE STATE;
#ifdef _LONG_ADDR_SPACE_
volatile uint_farptr_t SNfix;
#else
volatile uint8_t *SNfix;
#endif
volatile uint8_t *SNvar;
//uint8_t SN[IDISN_FULL_LENGTH];
} IDISTATUS_SLAVE_TYPE;
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#endif //_INC_IDIBUS_DEFS_H_
//#############################################################################################################################################################################################################

@ -0,0 +1,30 @@
//#############################################################################################################################################################################################################
#ifndef _INC_IDIBUS_IMPL_H_
#define _INC_IDIBUS_IMPL_H_
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#include <inttypes.h>
#include <avr/io.h>
#include <util/delay.h>
#include "System.h"
#include "bootFunctions.h"
#include <avr/pgmspace.h>
#include "USART_COM.h"
#include "RSLink.h"
#include "CRCs.h"
//#include "EEPROM_Fast.h"
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
typedef struct {
uint8_t ComFunc;
uint16_t InpDataLength;
volatile uint8_t *OutData;
uint16_t OutDataLength;
uint8_t SMPS;
} IDIBUS_FARG_TYPE;
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#define IDIBUS_SYSTEM_SW_VERSION 0x3133U
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#endif // #ifndef _INC_IDIBUS_IMPL_H_
//#############################################################################################################################################################################################################

@ -0,0 +1,23 @@
#include "MEMORY.h"
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#include "boot.h"
#include "device.h"
//This part will never ever change in a scope of one PCB
const volatile flash_datablock_t STATIC_DATA_BL __attribute__((section(".locationInBoot"),used)) =
{
.Padding = 0x0,
DEVICE_CFG,
.SW = {BOOT_VERSION_MAJOR,BOOT_VERSION_MINOR},
.AppCRC = 0xFFFFFFFF, //No need for it
}
;
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//This part will never ever change in a scope of one PCB. Except...
const volatile flash_datablock_t STATIC_DATA_APP __attribute__((section(".locationInApp"),used)) = {
.Padding = 0x0,
DEVICE_CFG,
.SW = {APP_V_MAJOR, APP_V_MINOR}, //<--This one
.AppCRC = 0xFFFFFFFF,
} ;
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

@ -0,0 +1,23 @@
#ifndef MEMORY_H_
#define MEMORY_H_
#include "boot.h"
#include "IDIBUS_DEFS.h"
typedef volatile struct{ //Size in bytes =
volatile uint8_t Padding;
volatile uint8_t GS1_country[IDISN_FIXP_GS1_COUNTRY_Length];
volatile uint8_t GS1_company[IDISN_FIXP_GS1_COMPANY_Length];
volatile uint8_t ModuleType[IDISN_FIXP_MODULE_TYPE_Length];
volatile uint8_t HW_revision[IDISN_FIXP_HW_REV_Length];
volatile uint8_t SN[IDISN_FIXP_SERIAL_Length];
volatile uint8_t MAC[IDISN_FIXP_MAC_Length];
volatile uint8_t SW[IDISN_FIXP_SW_REV_Length]; //SW Version (Bootloader/App)
volatile uint32_t AppCRC; //Only in APP
} flash_datablock_t;
//Universal data block
extern const volatile flash_datablock_t STATIC_DATA_APP __attribute__((section (".locationInApp")));
extern const volatile flash_datablock_t STATIC_DATA_BL __attribute__((section (".locationInBoot")));
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#endif /* MEMORY_H_ */

@ -0,0 +1,218 @@
//#############################################################################################################################################################################################################
#include "RSLink.h"
#include "idibus_hw.h"
#include "System.h"
#include "MEMORY.h"
#include "boot.h"
#include "bootFunctions.h"
#include "USART1.h"
#include "IDIBUS_IMPL.h"
static uint8_t RS_Address;
static uint8_t RS_SpeedCode;
static uint8_t mmes_buf[IDIMMES_MAX_MES_SIZE]; //RX buffer for copy. Store last msg here
static IDIBUS_FARG_TYPE FARG;
flash_datablock_t dataBoot;
static void RSLink_SendSMES()
{
if (FARG.OutDataLength > IDISMES_ERROR_Pos)
{
FARG.OutData[IDISMES_ADDR_Pos] = RS_Address;
FARG.OutData[IDISMES_SMPS_Pos] = FARG.SMPS;
uint16_t crc16 = CRC16(&FARG.OutData[0], FARG.OutDataLength);
FARG.OutData[FARG.OutDataLength++] = (uint8_t)(crc16 >> 8);
FARG.OutData[FARG.OutDataLength++] = (uint8_t) crc16;
USART1_SendTxBuf(FARG.OutDataLength);
}
}
static void IDIBUS_ResponseProtectedWrite(uint8_t *Data, uint16_t DataLength, uint8_t ErrorCode)
{
if ( ErrorCode != IDIER_NOPE )
{
FARG.SMPS |= 1;
}
else
{
FARG.SMPS &= ~(1);
}
FARG.OutData[IDISMES_ERROR_Pos] = ErrorCode;
FARG.OutDataLength = (uint16_t)(FARG.OutDataLength + 1);
if (Data != NULL)
{
_memcopy(Data, &FARG.OutData[IDISMES_DATA_Pos], DataLength);
FARG.OutDataLength = (uint16_t)(FARG.OutDataLength + DataLength);
}
RSLink_SendSMES();
}
static void IDIBUS_ModuleCommandHandler()
{
if (FARG.ComFunc == IDIMMES_COM_C_Init)
{
IDIBUS_ResponseProtectedWrite(NULL,0,IDIER_NOPE);
}
else if (FARG.ComFunc == IDIMMES_COM_C_ReadDevFullSN_MS)
{
flash_datablock_t dataBootR = dataBoot;
dataBootR.SW[0] = 0;dataBootR.SW[1] = 0;
IDIBUS_ResponseProtectedWrite((uint8_t*)&dataBootR,sizeof(dataBootR),IDIER_NOPE);
}
else if (FARG.ComFunc == IDIMMES_COM_C_FmwBootloaderInfo)
{
IDIBUS_ResponseProtectedWrite((uint8_t*)&dataBoot.SW,sizeof(dataBoot.SW),IDIER_NOPE);
}
else if (FARG.ComFunc == IDIMMES_COM_C_FmwBootloaderStart)
{
if (FARG.InpDataLength == sizeof(FMW_INFO)){
//Some input came with MMES
FMW_INFO fw_info;
_memcopy(&mmes_buf[3], (uint8_t*)&fw_info,sizeof(FMW_INFO));
if (BootloaderUpdateInit(fw_info))
{
IDIBUS_ResponseProtectedWrite(NULL, 0,IDIERSLV_NO_FIRMWARE);
}
else
{
IDIBUS_ResponseProtectedWrite(NULL, 0, IDIER_NOPE);
}
}
else
{
//No input came with MMES
IDIBUS_ResponseProtectedWrite(NULL, 0,
IDIERSLV_INVALID_RX_REQUEST_FORMAT);
}
}
else if (FARG.ComFunc == IDIMMES_COM_C_FmwBootloaderWrite)
{
if (FARG.InpDataLength != SPM_PAGESIZE)
{
IDIBUS_ResponseProtectedWrite(NULL, 0, IDIERSLV_INVALID_RX_REQUEST_FORMAT);
}
else
{
BootloaderUpdateHandler(&mmes_buf[3]);
IDIBUS_ResponseProtectedWrite(NULL,0,IDIER_NOPE);
}
}
else if (FARG.ComFunc == IDIMMES_COM_C_FmwBootloaderEnd)
{
if(BootloaderUpdateEnd())
{
IDIBUS_ResponseProtectedWrite(NULL, 0, IDIERSLV_NO_FIRMWARE);
}
else
{
IDIBUS_ResponseProtectedWrite(NULL, 0, IDIER_NOPE);
//RSLink_SendSMES();
while(USART1_IsTxActive());
//Gotta restart now
LaunchApplication();
}
}
else if (FARG.ComFunc == IDIMMES_COM_C_GotoApp)
{
IDIBUS_ResponseProtectedWrite(NULL, 0, IDIER_NOPE);
//RSLink_SendSMES();
while(USART1_IsTxActive());
LaunchApplication();
}
else
{
IDIBUS_ResponseProtectedWrite(NULL, 0, IDIERSLV_UNSUPPORTED_FUNC_NUM);
}
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void RSLink_Init()
{
readDeviceData(&dataBoot, locationInBoot);
FARG.OutData = USART1_getTxBuf(); //set RX addr
USART1_RxTransferRestart(); // Restart RX
USART1_SetIdiBusBoudrate(RSLink_SpeedDecode());
RS_Address = RSLink_AddrDecode();
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void RSLink_Handler(void)
{
#ifdef _LONG_ADDR_SPACE_
// No dynamic adr and speed change for 328pb
if(!USART1_IsTxActive())
{
uint8_t SpeedDSW_Code = RSLink_SpeedDecode();
if (RS_SpeedCode != SpeedDSW_Code)
{
RS_SpeedCode = SpeedDSW_Code;
USART1_SetIdiBusBoudrate(RS_SpeedCode);
}
}
RS_Address = RSLink_AddrDecode();
#endif
//Manage transfer status=====================================================
if ( !USART1_IsNewRxMessage() )
{
return;
}
if ( USART1_IsRxError())
{
USART1_RxTransferRestart();
return;
}
//==========================================================================
// Check normal Message
// Check Message size
static uint16_t RxMessageSize;
RxMessageSize = USART1_getRxBufSize();
if ( (RxMessageSize < (MODBUS_CRC16_SIZE+1) ) || (RxMessageSize > IDIMMES_MAX_MES_SIZE) )
{
//Bad message size. Restart------------------------------------------------------
USART1_RxTransferRestart();
return;
}
//Good message. Copy it to local buf and continue---------------------------
USART1_copyRxBuf( &mmes_buf[IDIMMES_ADDR_Pos], IDIMMES_ADDR_Pos, RxMessageSize ); // Need for CRC
USART1_RxTransferRestart();
//Parse address
uint8_t RcvAddress;
RcvAddress = mmes_buf[IDIMMES_ADDR_Pos];
// MMESG(Module) or MMES -------------
//That's our address.
if ( RcvAddress == RS_Address )
{
//Calculate msg's CRC
uint16_t CalculatedCRC = CRC16( mmes_buf, (uint16_t)(RxMessageSize-2) );
//Read msg's CRC. Last two bytes???
uint16_t ReceivedCRC = (uint16_t)( ((uint16_t)mmes_buf[RxMessageSize-2] << 8) | mmes_buf[RxMessageSize-1] );
if ( CalculatedCRC != ReceivedCRC )
{
//CRC doesn't match. BAD
return;
}
FARG.OutDataLength = IDISMES_ERROR_Pos; //Set length 2 (adr+cmd)
uint8_t MMPS = mmes_buf[IDIMMES_MMPS_Pos];
if ( (MMPS != (IDIMMES_MMPS_MES_TYPE_Msk)) || (RxMessageSize < IDIMMESG_MODULE_MIN_MES_SIZE))
{
IDIBUS_ResponseProtectedWrite(NULL, 0, IDIERSLV_INVALID_RX_REQUEST_FORMAT);
}
else
{
FARG.ComFunc = mmes_buf[IDIMMESG_DATA_COM_FUNC_Pos];
FARG.InpDataLength = (uint16_t)(RxMessageSize - (IDIMMESG_DATA_COM_FUNC_Pos + 1) - MODBUS_CRC16_SIZE);
IDIBUS_ModuleCommandHandler();
}
}
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//#############################################################################################################################################################################################################

@ -0,0 +1,15 @@
//#############################################################################################################################################################################################################
#ifndef _INC_RSLINK_H_
#define _INC_RSLINK_H_
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#include <inttypes.h>
#include "SYSTEM.h"
#include "USART1.h"
#include "IDIBUS_IMPL.h"
#include "MEMORY.h"
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void RSLink_Init();
void RSLink_Handler(void);
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#endif // #ifndef _INC_RSLINK_H_
//#############################################################################################################################################################################################################

@ -0,0 +1,127 @@
#include "USART1.h"
volatile USART_HANDLER_TYPE USART1STR ={
.TxBufCount = 0,
.TxSendedCount = 0,
.RxBufCount = 0,
.RxComplete = 0,
.TxComplete = 1,
.InterFrameTimeoutTicks = 0,
};
//Do not remove volatile!!!
volatile uint8_t USART1_RX_BUF[USART1_BUF_SIZE]; // RX buffer
volatile uint8_t USART1_TX_BUF[USART1_BUF_SIZE]; // TX buffer
// USARTs common settings : Speed and Timeouts
const uint16_t USART_UBRR[8] PROGMEM= { (F_CPU/8UL)/19200-1, (F_CPU/8UL)/500000-1,
(F_CPU/8UL)/2400-1, (F_CPU/8UL)/9600-1,
(F_CPU/8UL)/115200-1, (F_CPU/8UL)/250000-1,
(F_CPU/8UL)/1000000-1, /*(F_CPU/8UL)/10000000-1*/ 0
}; // Fosc=16MHz : 19.2k, 500k, 2.4k, 9.6k, 115.2k, 250k, 1M, 1M
const uint16_t USART_TIMEOUT[8] PROGMEM= { (IDIBUS_19200B_INTERFRAME_TIMEOUT_US/8*16), (IDIBUS_500K_INTERFRAME_TIMEOUT_US/8*16),
(IDIBUS_2400B_INTERFRAME_TIMEOUT_US/8*16), (IDIBUS_9600B_INTERFRAME_TIMEOUT_US/8*16),
(IDIBUS_115200B_INTERFRAME_TIMEOUT_US/8*16), (IDIBUS_250K_INTERFRAME_TIMEOUT_US/8*16),
(IDIBUS_1M_INTERFRAME_TIMEOUT_US/8*16), (IDIBUS_1M_INTERFRAME_TIMEOUT_US/8*16)
};
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ISR(USART1_TX_vect)
{
if (USART1STR.TxSendedCount == USART1STR.TxBufCount)
{
//UCSR1B &= ~((1<<TXCIE1)|(1<<TXEN1));
UCSR1B=(1<<RXCIE1)|(1<<RXEN1);
USART1STR.TxSendedCount = 0;
USART1STR.TxBufCount = 0;
USART1STR.TxComplete = 1;
USART1_TX_DDR&=~(1<<USART1_TX_BIT);
USART1_TX_PORT|=1<<USART1_TX_BIT; // TXD -> Z
USART1_DRE_DDR&=~(1<<USART1_DRE_BIT);
USART1_DRE_PORT&=~(1<<USART1_DRE_BIT); // RDE -> Z
}
else
{
UDR1=USART1_TX_BUF[USART1STR.TxSendedCount];
USART1STR.TxSendedCount++;
}
}
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ISR(USART1_RX_vect)
{
//TIMSK3=0;
TCNT3=0; // Timeout Timer3 On, clkI/O/8 (From prescaller)
TCCR3B=2;
TIMSK3=1<<OCIE3A;
if (UCSR1A & ((1<<FE1) | (1<<DOR1)) )
USART1STR.RxError = 1;
if (USART1STR.RxBufCount < USART1_BUF_SIZE)
{
USART1_RX_BUF[USART1STR.RxBufCount] = UDR1;
USART1STR.RxBufCount++;
}
}
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ISR(TIMER3_COMPA_vect)
{
TCCR3B=0;
TCNT3=0;
TIMSK3=0; // Timeout TIMER3 off
UCSR1B &= ~((1<<RXCIE1)|(1<<RXEN1)); // RX off
USART1STR.RxComplete = 1; // RX data ready
}
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void USART1_Init(void)
{
USART1_TX_DDR&=~(1<<USART1_TX_BIT);
USART1_TX_PORT|=1<<USART1_TX_BIT; // TXD -> Z
USART1_RX_DDR&=~(1<<USART1_RX_BIT);
USART1_RX_PORT|=1<<USART1_RX_BIT; // RXD -> Z
USART1_DRE_DDR&=~(1<<USART1_DRE_BIT);
USART1_DRE_PORT&=~(1<<USART1_DRE_BIT); // RDE -> 0
UCSR1A=(1<<U2X1);
UCSR1B=(1<<RXCIE1)|(1<<RXEN1); // RX enable
UCSR1C=(1<<UCSZ10)|(1<<UCSZ11)|(1<<USBS1); // 8 bit, 2 stop
TCCR3B=0;
TCNT3=0;
TIMSK3=0; // Timeout TIMER3 off
}
void USART1_copyRxBuf(uint8_t *Dst, uint16_t StartPos, uint16_t Count)
{
_memcopy(&USART1_RX_BUF[StartPos], Dst,Count);
}
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void USART1_SetIdiBusBoudrate(enum IDIBUS_SERIAL_BAUDRATE BoudrateCode)
{
UBRR1 = flash_read_word((USART_UBRR),(BoudrateCode<<1));
USART1STR.InterFrameTimeoutTicks = flash_read_word((USART_TIMEOUT),(BoudrateCode << 1));
OCR3A = USART1STR.InterFrameTimeoutTicks;
}
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void USART1_SendTxBuf(uint16_t Count)
{
if ( (!USART1STR.TxComplete) || (Count == 0) || (Count > USART1_BUF_SIZE) )
{
return;
}
USART1_TX_DDR|=1<<USART1_TX_BIT;
USART1_TX_PORT|=1<<USART1_TX_BIT; // TXD -> out
USART1_DRE_DDR|=1<<USART1_DRE_BIT;
USART1_DRE_PORT|=1<<USART1_DRE_BIT;
USART1STR.TxComplete = 0;
USART1STR.TxBufCount = Count;
USART1STR.TxSendedCount = 1;
//UCSR1B &= ~((1<<RXCIE1)|(1<<RXEN1)); // RX off
UCSR1B=(1<<TXCIE1)|(1<<TXEN1);
UDR1 = USART1_TX_BUF[0];
}
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void USART1_RxTransferRestart(void)
{
UCSR1B|=(1<<RXCIE1)|(1<<RXEN1);
USART1STR.RxBufCount = 0;
USART1STR.RxComplete = 0;
USART1STR.RxError = 0;
}
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

@ -0,0 +1,37 @@
#ifndef USART1_H_
#define USART1_H_
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#include <inttypes.h>
#include "IDIBUS_DEFS.h"
#include <avr/io.h>
#include <avr/interrupt.h>
#include "USART_COM.h"
#define USART1_BUF_SIZE IDIMMES_MAX_MES_SIZE + 1 // Buffer size
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern volatile USART_HANDLER_TYPE USART1STR; //Do not remove volatile!!!
extern volatile uint8_t USART1_RX_BUF[]; // RX buffer
extern volatile uint8_t USART1_TX_BUF[]; // TX buffer
void USART1_Init(void);
void USART1_SendTxBuf(uint16_t Count);
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void USART1_RxTransferRestart(void);
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void USART1_copyRxBuf(uint8_t *Dst, uint16_t StartPos, uint16_t Count);
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#define USART1_IsTxActive() !USART1STR.TxComplete
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#define USART1_IsNewRxMessage() USART1STR.RxComplete
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#define USART1_IsRxError() USART1STR.RxError
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#define USART1_getRxBufSize() USART1STR.RxBufCount
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#define USART1_getRxBuf() &USART1_RX_BUF[0]
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#define USART1_getTxBuf() &USART1_TX_BUF[0]
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void USART1_SetIdiBusBoudrate(enum IDIBUS_SERIAL_BAUDRATE BoudrateCode);
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#endif /* USART1_H_ */

@ -0,0 +1,36 @@
//#############################################################################################################################################################################################################
#ifndef _INC_USART_COM_H_
#define _INC_USART_COM_H_
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#include <inttypes.h>
#include "System.h"
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#define F_CPU 16000000UL
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#ifdef __ATmega328PB__ //Maybe move this
#include "m328pb_defs.h"
#endif // #ifdef _CPU_ATMEGA328PB_
#ifdef __ATmega1280__
#include "m2560_defs.h"
#endif // _CPU_ATMEGA2560_
#ifdef __ATmega2560__
#include "m2560_defs.h"
#endif // _CPU_ATMEGA2560_
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
typedef struct {
volatile uint16_t TxBufCount;
uint16_t TxSendedCount;
volatile uint16_t RxBufCount;
uint16_t InterFrameTimeoutTicks;
volatile uint8_t TxComplete;
volatile uint8_t RxError;
volatile uint8_t RxComplete;
} USART_HANDLER_TYPE;
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#endif //_INC_USART_COM_H_
//#############################################################################################################################################################################################################

@ -0,0 +1,113 @@
#
# There exist several targets which are by default empty and which can be
# used for execution of your targets. These targets are usually executed
# before and after some main targets. They are:
#
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
#
# Targets beginning with '.' are not intended to be called on their own.
#
# Main targets can be executed directly, and they are:
#
# build build a specific configuration
# clean remove built files from a configuration
# clobber remove all built files
# all build all configurations
# help print help mesage
#
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
# .help-impl are implemented in nbproject/makefile-impl.mk.
#
# Available make variables:
#
# CND_BASEDIR base directory for relative paths
# CND_DISTDIR default top distribution directory (build artifacts)
# CND_BUILDDIR default top build directory (object files, ...)
# CONF name of current configuration
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
#
# NOCDDL
# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib
# build
build: .build-post
.build-pre:
# Add your pre 'build' code here...
.build-post: .build-impl
# Add your post 'build' code here...
# clean
clean: .clean-post
.clean-pre:
# Add your pre 'clean' code here...
# WARNING: the IDE does not call this target since it takes a long time to
# simply run make. Instead, the IDE removes the configuration directories
# under build and dist directly without calling make.
# This target is left here so people can do a clean when running a clean
# outside the IDE.
.clean-post: .clean-impl
# Add your post 'clean' code here...
# clobber
clobber: .clobber-post
.clobber-pre:
# Add your pre 'clobber' code here...
.clobber-post: .clobber-impl
# Add your post 'clobber' code here...
# all
all: .all-post
.all-pre:
# Add your pre 'all' code here...
.all-post: .all-impl
# Add your post 'all' code here...
# help
help: .help-post
.help-pre:
# Add your pre 'help' code here...
.help-post: .help-impl
# Add your post 'help' code here...
# include project implementation makefile
include nbproject/Makefile-impl.mk
# include project make variables
include nbproject/Makefile-variables.mk

@ -0,0 +1,8 @@
## ВНИМАНИЕ!
Контроллер нужно выбирать через активную конфигурацию проекта, а не через Dashboard.
Проверены контроллеры: AT2560
Добавлена функция распознавания типа прошивки (шифр/нешифр)
Исправлены ошибки, возникавшие при внезапном обрыве процесса прошивки

@ -0,0 +1,249 @@
//#############################################################################################################################################################################################################
#include "AES.h"
//=============================================================================================================================================================================================================
static const uint8_t AES_INV_SBOX[256] PROGMEM=
{
0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38, 0xBF, 0x40, 0xA3, 0x9E, 0x81, 0xF3, 0xD7, 0xFB,
0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87, 0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB,
0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D, 0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E,
0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2, 0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25,
0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92,
0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA, 0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84,
0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A, 0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06,
0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02, 0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B,
0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA, 0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73,
0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85, 0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E,
0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89, 0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B,
0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20, 0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4,
0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F,
0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D, 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF,
0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0, 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61,
0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D
};
//=============================================================================================================================================================================================================
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//=============================================================================================================================================================================================================
static uint8_t AES_RotWord(uint8_t *Word)
{
Word[0+4] = Word[1];
Word[1+4] = Word[2];
Word[2+4] = Word[3];
Word[3+4] = Word[0];
return Word[1];
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
static uint8_t AES_SubWord (uint8_t Word)
{
//for (uint8_t i = 0; i < 256; i++){ //FIND BETTER SOLUTION (with out using precomputed values)
// if (flash_read_byte((AES_INV_SBOX),i) == Word)
// return i;
//}
//return 0;
uint8_t j = 0,i = 0;
do
{
if (flash_read_byte((AES_INV_SBOX),i) == Word)
j = i;
i++;
}
while (i != 0);
return j;
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
static const uint8_t Rcon[7] PROGMEM= { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40};//, 0x80};//, 0x1B, 0x36 };
static void AES_KeyExpansion(uint8_t *AES_KEY, uint8_t *w)
{
uint8_t KeyTmp;
uint8_t I;
//for (I = 0; I < AES_NK_256BIT*4; I++)
//{
// w[I] = pgm_read_byte(&(AES_KEY[I]));
//}
_memcopy(AES_KEY,w,AES_NK_256BIT*4);
for (I = AES_NK_256BIT*4; I < (uint8_t)(AES_NB*(uint8_t)(AES_NR_256BIT+1U)*4); I++)
{
KeyTmp = w[I-4];
if ((I & 0b11100) == 0 )
{
if ((I & 0b11) == 0 )
{
KeyTmp = AES_RotWord(&w[I-4]);
KeyTmp = AES_SubWord(KeyTmp);
//KeyTmp = KeyTmp ^ (1<<(I>>5));
KeyTmp = KeyTmp ^ flash_read_byte((Rcon),(I>>5)-1);
}
else
KeyTmp = AES_SubWord(w[I]);
}
else if ( (I & 0b11100) == 16 )
KeyTmp = AES_SubWord(w[I-4]);
w[I] = w[I-(AES_NK_256BIT*4)] ^ KeyTmp;
}
}
//=============================================================================================================================================================================================================
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//=============================================================================================================================================================================================================
//uint8_t AES_xTime(uint8_t Value) { return ( (Value & 0x80) ? ((uint8_t)(Value<<1)^0x1B) : (uint8_t)(Value<<1) ); }
//
//#define AES_MULTIPLY_02(X) AES_xTime((X))
//#define AES_MULTIPLY_03(X) ( (X) ^ AES_xTime((X)) )
//#define AES_MULTIPLY_09(X) ( (X) ^ AES_xTime(AES_xTime(AES_xTime((X)))) )
//#define AES_MULTIPLY_0B(X) ( (X) ^ AES_xTime((X)) ^ AES_xTime(AES_xTime(AES_xTime((X)))) )
//#define AES_MULTIPLY_0E(X) ( AES_xTime((X)) ^ AES_xTime(AES_xTime((X))) ^ AES_xTime(AES_xTime(AES_xTime((X)))) )
//#define AES_MULTIPLY_0D(X) ( (X) ^ AES_xTime(AES_xTime((X))) ^ AES_xTime(AES_xTime(AES_xTime((X)))) )
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//static uint8_t rstate[4*AES_NB];
#define GF28_MUL2(a) { asm ("lsl %0 \n brcc .+2 \n eor %0, %1 \n" : "=r" (a) : "r" (c0x1b), "0" (a)); }
//#define GF28_MUL2(a) { if (a&0x80) { a = (a<<1) ^ 0x1b; } else { a <<= 1; } }
//#define GF28_MUL2(a) {a=AES_xTime(a);}
static void AES_InvMixColumns(uint8_t *state)
{
//for (uint8_t i = 0; i<16; i++)
// rstate[i]=state[i];
//_memcopy(state,rstate,16);
const uint8_t c0x1b = 0x1b;
uint8_t i, a0, a1, a2, a3, sum, b, c, d, e;
uint8_t* ptr = state;
for(i = 0; i < 16; i+=4) //https://github.com/kildom/AVR-AES/blob/master/aes.c I don't fully understand this, but it works really fast
{
a0 = ptr[0];
a1 = ptr[1];
a2 = ptr[2];
a3 = ptr[3];
sum = a0 ^ a1 ^ a2 ^ a3;
c = sum;
GF28_MUL2(c);
d = c ^ a0 ^ a2;
GF28_MUL2(d);
GF28_MUL2(d);
d ^= sum;
e = c ^ a1 ^ a3;
GF28_MUL2(e);
GF28_MUL2(e);
e ^= sum;
b = a0^a1;
GF28_MUL2(b);
*ptr++ = d ^ a0 ^ b;
b = a1^a2;
GF28_MUL2(b);
*ptr++ = e ^ a1 ^ b;
b = a2^a3;
GF28_MUL2(b);
*ptr++ = d ^ a2 ^ b;
b = a3^a0;
GF28_MUL2(b);
*ptr++ = e ^ a3 ^ b;
}
//for (uint8_t i = 0; i < 16; i++){
// state[i] = AES_MULTIPLY_0E(rstate[(i&0xFC)+((i+0)&0b11)])
// ^ AES_MULTIPLY_0B(rstate[(i&0xFC)+((i+1)&0b11)])
// ^ AES_MULTIPLY_0D(rstate[(i&0xFC)+((i+2)&0b11)])
// ^ AES_MULTIPLY_09(rstate[(i&0xFC)+((i+3)&0b11)]);
//}
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void AES_AddRoundKey (uint8_t *State, uint8_t *_key)
{
for (uint8_t i = 0; i < 16; i++)
State[i] ^= (_key[i]);
}
//=============================================================================================================================================================================================================
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//=============================================================================================================================================================================================================
void AES_InvShiftRows(uint8_t *state)
{
uint8_t ByteTmp1;
uint8_t ByteTmp2;
//Do not loop!!! Otherwise bad performance
ByteTmp1 = state[13];
state[13] = state[9];
state[9] = state[5];
state[5] = state[1];
state[1] = ByteTmp1;
ByteTmp1 = state[14];
ByteTmp2 = state[10];
state[14] = state[6];
state[10] = state[2];
state[6] = ByteTmp1;
state[2] = ByteTmp2;
ByteTmp1 = state[3];
state[3] = state[7];
state[7] = state[11];
state[11] = state[15];
state[15] = ByteTmp1;
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
static void AES_InvSubBytes(uint8_t *state)
{
for (uint8_t i = 0; i < 16; i++)
state[i] = flash_read_byte((AES_INV_SBOX),state[i]);
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
static uint8_t NextIV[16];
static void AES_InvCipher(uint8_t *IN, uint8_t *w, uint8_t *IV)
{
uint8_t *state = IN;
_memcopy(IN,NextIV,16);
AES_AddRoundKey(state, &w[AES_NR_256BIT*AES_NB*4]);
for (uint8_t I = (uint8_t)(AES_NR_256BIT-1); I > 0; I--)
{
AES_InvShiftRows(state);
AES_InvSubBytes(state);
AES_AddRoundKey(state, &w[I<<4]);
AES_InvMixColumns(state);
}
AES_InvShiftRows(state);
AES_InvSubBytes(state);
AES_AddRoundKey(state, &w[0]);
AES_AddRoundKey(state, IV); //XOR output with IV
_memcopy(NextIV,IV,16);
}
//=============================================================================================================================================================================================================
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//=============================================================================================================================================================================================================
static uint8_t w[(uint8_t)(AES_NB * (uint8_t)(AES_NR_256BIT+1U))*4];
static uint8_t IVstored[16];
void AES_Decrypt(uint8_t *InpData, uint16_t InpDataLength)
{
//if (KeyLength != AES_256) return; //Only AES CBC 256 is supported
if ( (InpDataLength & 0b1111) != 0 )
{
return;
}
uint16_t DataPos = 0;
while ( InpDataLength > 0 )
{
AES_InvCipher(&InpData[DataPos], w, IVstored);
DataPos = (uint16_t)(DataPos + AES_BLOCK_SIZE);
InpDataLength = (uint16_t)(InpDataLength - AES_BLOCK_SIZE);
}
wdt_reset();
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void AES_PrepareKeys(uint8_t *Key, uint8_t *IV)
{
AES_KeyExpansion(Key, w);
_memcopy(IV,IVstored,16);
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//#############################################################################################################################################################################################################

@ -0,0 +1,33 @@
//#############################################################################################################################################################################################################
#ifndef _INC_AES_H_
#define _INC_AES_H_
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#include <inttypes.h>
#include "SYSTEM.h"
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#define AES_NB 4U
#define AES_NK_256BIT 8U
#define AES_NR_256BIT 14U
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#define AES_KEY_AES256_SIZE 32U
#define AES_BLOCK_SIZE 16U
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/*
enum AES_CIPHER_KEY_LENGTH {
AES_128 = 0x00,
AES_192, //UNSUPPORTED
AES_256
};
*/
//ONLY AES256 SUPPORTED!!!
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void AES_Decrypt(uint8_t *InpData, uint16_t InpDataLength);
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void AES_PrepareKeys(uint8_t *Key, uint8_t *IV);
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#endif //_INC_AES_H_
//#############################################################################################################################################################################################################

@ -0,0 +1,110 @@
#include "CRCs.h"
uint16_t CRC16(volatile uint8_t *data, uint16_t length)
{
uint16_t crc=0xFFFF;
for (uint16_t Mp=0; Mp<length; Mp++)
{
crc^=(uint16_t)data[Mp]; // XOR byte into least sig. byte of crc
for (uint8_t Mi=8; Mi!=0; Mi--) // Loop over each bit
{
uint8_t tmp = (crc&0x0001);
crc>>=1;
if (tmp != 0) crc^=0xA001;
}
}
return crc;
}
#ifdef _FAT_CRC_
const uint32_t crc32Lookup[256] PROGMEM =
{
0x00000000,0x77073096,0xEE0E612C,0x990951BA,0x076DC419,0x706AF48F,0xE963A535,0x9E6495A3,
0x0EDB8832,0x79DCB8A4,0xE0D5E91E,0x97D2D988,0x09B64C2B,0x7EB17CBD,0xE7B82D07,0x90BF1D91,
0x1DB71064,0x6AB020F2,0xF3B97148,0x84BE41DE,0x1ADAD47D,0x6DDDE4EB,0xF4D4B551,0x83D385C7,
0x136C9856,0x646BA8C0,0xFD62F97A,0x8A65C9EC,0x14015C4F,0x63066CD9,0xFA0F3D63,0x8D080DF5,
0x3B6E20C8,0x4C69105E,0xD56041E4,0xA2677172,0x3C03E4D1,0x4B04D447,0xD20D85FD,0xA50AB56B,
0x35B5A8FA,0x42B2986C,0xDBBBC9D6,0xACBCF940,0x32D86CE3,0x45DF5C75,0xDCD60DCF,0xABD13D59,
0x26D930AC,0x51DE003A,0xC8D75180,0xBFD06116,0x21B4F4B5,0x56B3C423,0xCFBA9599,0xB8BDA50F,
0x2802B89E,0x5F058808,0xC60CD9B2,0xB10BE924,0x2F6F7C87,0x58684C11,0xC1611DAB,0xB6662D3D,
0x76DC4190,0x01DB7106,0x98D220BC,0xEFD5102A,0x71B18589,0x06B6B51F,0x9FBFE4A5,0xE8B8D433,
0x7807C9A2,0x0F00F934,0x9609A88E,0xE10E9818,0x7F6A0DBB,0x086D3D2D,0x91646C97,0xE6635C01,
0x6B6B51F4,0x1C6C6162,0x856530D8,0xF262004E,0x6C0695ED,0x1B01A57B,0x8208F4C1,0xF50FC457,
0x65B0D9C6,0x12B7E950,0x8BBEB8EA,0xFCB9887C,0x62DD1DDF,0x15DA2D49,0x8CD37CF3,0xFBD44C65,
0x4DB26158,0x3AB551CE,0xA3BC0074,0xD4BB30E2,0x4ADFA541,0x3DD895D7,0xA4D1C46D,0xD3D6F4FB,
0x4369E96A,0x346ED9FC,0xAD678846,0xDA60B8D0,0x44042D73,0x33031DE5,0xAA0A4C5F,0xDD0D7CC9,
0x5005713C,0x270241AA,0xBE0B1010,0xC90C2086,0x5768B525,0x206F85B3,0xB966D409,0xCE61E49F,
0x5EDEF90E,0x29D9C998,0xB0D09822,0xC7D7A8B4,0x59B33D17,0x2EB40D81,0xB7BD5C3B,0xC0BA6CAD,
0xEDB88320,0x9ABFB3B6,0x03B6E20C,0x74B1D29A,0xEAD54739,0x9DD277AF,0x04DB2615,0x73DC1683,
0xE3630B12,0x94643B84,0x0D6D6A3E,0x7A6A5AA8,0xE40ECF0B,0x9309FF9D,0x0A00AE27,0x7D079EB1,
0xF00F9344,0x8708A3D2,0x1E01F268,0x6906C2FE,0xF762575D,0x806567CB,0x196C3671,0x6E6B06E7,
0xFED41B76,0x89D32BE0,0x10DA7A5A,0x67DD4ACC,0xF9B9DF6F,0x8EBEEFF9,0x17B7BE43,0x60B08ED5,
0xD6D6A3E8,0xA1D1937E,0x38D8C2C4,0x4FDFF252,0xD1BB67F1,0xA6BC5767,0x3FB506DD,0x48B2364B,
0xD80D2BDA,0xAF0A1B4C,0x36034AF6,0x41047A60,0xDF60EFC3,0xA867DF55,0x316E8EEF,0x4669BE79,
0xCB61B38C,0xBC66831A,0x256FD2A0,0x5268E236,0xCC0C7795,0xBB0B4703,0x220216B9,0x5505262F,
0xC5BA3BBE,0xB2BD0B28,0x2BB45A92,0x5CB36A04,0xC2D7FFA7,0xB5D0CF31,0x2CD99E8B,0x5BDEAE1D,
0x9B64C2B0,0xEC63F226,0x756AA39C,0x026D930A,0x9C0906A9,0xEB0E363F,0x72076785,0x05005713,
0x95BF4A82,0xE2B87A14,0x7BB12BAE,0x0CB61B38,0x92D28E9B,0xE5D5BE0D,0x7CDCEFB7,0x0BDBDF21,
0x86D3D2D4,0xF1D4E242,0x68DDB3F8,0x1FDA836E,0x81BE16CD,0xF6B9265B,0x6FB077E1,0x18B74777,
0x88085AE6,0xFF0F6A70,0x66063BCA,0x11010B5C,0x8F659EFF,0xF862AE69,0x616BFFD3,0x166CCF45,
0xA00AE278,0xD70DD2EE,0x4E048354,0x3903B3C2,0xA7672661,0xD06016F7,0x4969474D,0x3E6E77DB,
0xAED16A4A,0xD9D65ADC,0x40DF0B66,0x37D83BF0,0xA9BCAE53,0xDEBB9EC5,0x47B2CF7F,0x30B5FFE9,
0xBDBDF21C,0xCABAC28A,0x53B39330,0x24B4A3A6,0xBAD03605,0xCDD70693,0x54DE5729,0x23D967BF,
0xB3667A2E,0xC4614AB8,0x5D681B02,0x2A6F2B94,0xB40BBE37,0xC30C8EA1,0x5A05DF1B,0x2D02EF8D
};
#ifdef _LONG_ADDR_SPACE_
uint32_t CRC32(void* data, uint32_t length)
#else
//uint32_t CRC32(uint8_t* data, uint16_t length)
#endif
{
uint32_t crc = (~(0));
#ifdef _LONG_ADDR_SPACE_
uint32_t flashAddr = 0;
#else
//uint16_t flashAddr = 0;
#endif
uint8_t offset;
while (length--)
{
if (data != NULL) offset = ((uint8_t)crc) ^ *(uint8_t*)data++;
else offset = ((uint8_t)crc) ^ pgm_read_byte_far(flashAddr++);
crc = (crc >> 8) ^ pgm_read_dword_far(pgm_get_far_address(crc32Lookup) + ((uint16_t)offset<<2));
}
return ~crc; // same as crc ^ 0xFFFFFFFF
}
#else
uint32_t CRC32(void* dat, uint16_t length)
{
#define Polynomial 0xEDB88320
uint32_t crc = 0xFFFFFFFF; // same as previousCrc32 ^ 0xFFFFFFFF
uint16_t flashAddr = 0;
uint8_t *data = dat;
while (length--)
{
if (data != NULL) crc ^= *data++; //Check data pointer
else crc ^= pgm_read_byte(flashAddr++); //Check flash memory
for (uint8_t j = 0; j < 8; j++)
{
uint8_t lowestBit = crc & 1;
crc >>= 1;
if (lowestBit) crc ^= Polynomial;
}
}
return ~crc; // same as crc ^ 0xFFFFFFFF
}
#endif

@ -0,0 +1,19 @@
#ifndef CRCS_H_
#define CRCS_H_
#include "config.h"
#include <stddef.h>
#include <inttypes.h>
#include <avr/pgmspace.h>
uint16_t CRC16(volatile uint8_t *data, uint16_t length);
#ifdef _LONG_ADDR_SPACE_
uint32_t CRC32(void* data, uint32_t length);
#else
uint32_t CRC32(void* data, uint16_t length);
#endif
#endif /* CRCS_H_ */

@ -0,0 +1,18 @@
#include "System.h"
/*
@param src - from
* @param dest - to
*/
void _memcopy(volatile uint8_t *src,volatile uint8_t *dest, uint16_t size)
{
for (uint16_t pos = 0; pos < size; pos++)
{
dest[pos] = src[pos];
}
}
void System_SWReboot()
{
cli();
while(1);//Dumb reset
}

@ -0,0 +1,27 @@
#ifndef SYSTEM_H_
#define SYSTEM_H_
#include <inttypes.h>
#include "config.h"
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <avr/wdt.h>
#include <avr/interrupt.h>
#ifdef _LONG_ADDR_SPACE_
#define flash_read_byte(x,y) pgm_read_byte_far(pgm_get_far_address(x)+y)
#define flash_read_word(x,y) pgm_read_word_far(pgm_get_far_address(x)+y)
#define flash_read_dword(x,y) pgm_read_dword_far(pgm_get_far_address(x)+y)
#else
#define flash_read_byte(x,y) pgm_read_byte((uint16_t)(&x)+y)
#define flash_read_word(x,y) pgm_read_word((uint16_t)(&x)+y)
#define flash_read_dword(x,y) pgm_read_dword((uint16_t)(&x)+y)
#endif
//#define NULL 0
void _memcopy(volatile uint8_t *src,volatile uint8_t *dest, uint16_t size);
void System_SWReboot();
#endif /* SYSTEM_H_ */

@ -0,0 +1,21 @@
// USARTCUSTOM (FOR 128)
#define USART1_TX_DDR DDRD
#define USART1_TX_PORT PORTD
#define USART1_TX_BIT 3
#define USART1_RX_DDR DDRD
#define USART1_RX_PORT PORTD
#define USART1_RX_BIT 2
#define USART1_DRE_DDR DDRD
#define USART1_DRE_PORT PORTD
#define USART1_DRE_BIT 4
// USARTCUSTOM (FOR 128)
#define USART0_TX_DDR DDRE
#define USART0_TX_PORT PORTE
#define USART0_TX_BIT 1
#define USART0_RX_DDR DDRE
#define USART0_RX_PORT PORTE
#define USART0_RX_BIT 0
// EEPROM compatibility with newer MCUs
#define EEMPE EEMWE
#define EEPE EEWE

@ -0,0 +1,17 @@
// USARTCUSTOM (FOR 2560)
#define USART1_TX_DDR DDRD
#define USART1_TX_PORT PORTD
#define USART1_TX_BIT 3
#define USART1_RX_DDR DDRD
#define USART1_RX_PORT PORTD
#define USART1_RX_BIT 2
#define USART1_DRE_DDR DDRD
#define USART1_DRE_PORT PORTD
#define USART1_DRE_BIT 4
// USARTCUSTOM (FOR 2560)
#define USART0_TX_DDR DDRE
#define USART0_TX_PORT PORTE
#define USART0_TX_BIT 1
#define USART0_RX_DDR DDRE
#define USART0_RX_PORT PORTE
#define USART0_RX_BIT 0

@ -0,0 +1,19 @@
//USART CUSTOM (FOR 328pb)
#define USART0_TX_DDR DDRD
#define USART0_TX_PORT PORTD
#define USART0_TX_BIT 1
#define USART0_RX_DDR DDRD
#define USART0_RX_PORT PORTD
#define USART0_RX_BIT 0
//USART CUSTOM (FOR 328pb)
#define USART1_TX_DDR DDRB
#define USART1_TX_PORT PORTB
#define USART1_TX_BIT 3
#define USART1_RX_DDR DDRB
#define USART1_RX_PORT PORTB
#define USART1_RX_BIT 4
#define USART1_DRE_DDR DDRB
#define USART1_DRE_PORT PORTB
#define USART1_DRE_BIT 5

@ -0,0 +1,267 @@
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a -pre and a -post target defined where you can add customized code.
#
# This makefile implements configuration specific macros and targets.
# Include project Makefile
ifeq "${IGNORE_LOCAL}" "TRUE"
# do not include local makefile. User is passing all local related variables already
else
include Makefile
# Include makefile containing local settings
ifeq "$(wildcard nbproject/Makefile-local-ATMega1280.mk)" "nbproject/Makefile-local-ATMega1280.mk"
include nbproject/Makefile-local-ATMega1280.mk
endif
endif
# Environment
MKDIR=gnumkdir -p
RM=rm -f
MV=mv
CP=cp
# Macros
CND_CONF=ATMega1280
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
IMAGE_TYPE=debug
OUTPUT_SUFFIX=elf
DEBUGGABLE_SUFFIX=elf
FINAL_IMAGE=${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
else
IMAGE_TYPE=production
OUTPUT_SUFFIX=hex
DEBUGGABLE_SUFFIX=elf
FINAL_IMAGE=${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
endif
ifeq ($(COMPARE_BUILD), true)
COMPARISON_BUILD=
else
COMPARISON_BUILD=
endif
# Object Directory
OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE}
# Distribution Directory
DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE}
# Source Files Quoted if spaced
SOURCEFILES_QUOTED_IF_SPACED=Bootloader/idibus_hw.c Bootloader/main.c Components/bootFunctions.c IdiBusSlave/MEMORY.c IdiBusSlave/RSLink.c IdiBusSlave/USART1.c Required/AES.c Required/CRCs.c Required/System.c
# Object Files Quoted if spaced
OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/Bootloader/idibus_hw.o ${OBJECTDIR}/Bootloader/main.o ${OBJECTDIR}/Components/bootFunctions.o ${OBJECTDIR}/IdiBusSlave/MEMORY.o ${OBJECTDIR}/IdiBusSlave/RSLink.o ${OBJECTDIR}/IdiBusSlave/USART1.o ${OBJECTDIR}/Required/AES.o ${OBJECTDIR}/Required/CRCs.o ${OBJECTDIR}/Required/System.o
POSSIBLE_DEPFILES=${OBJECTDIR}/Bootloader/idibus_hw.o.d ${OBJECTDIR}/Bootloader/main.o.d ${OBJECTDIR}/Components/bootFunctions.o.d ${OBJECTDIR}/IdiBusSlave/MEMORY.o.d ${OBJECTDIR}/IdiBusSlave/RSLink.o.d ${OBJECTDIR}/IdiBusSlave/USART1.o.d ${OBJECTDIR}/Required/AES.o.d ${OBJECTDIR}/Required/CRCs.o.d ${OBJECTDIR}/Required/System.o.d
# Object Files
OBJECTFILES=${OBJECTDIR}/Bootloader/idibus_hw.o ${OBJECTDIR}/Bootloader/main.o ${OBJECTDIR}/Components/bootFunctions.o ${OBJECTDIR}/IdiBusSlave/MEMORY.o ${OBJECTDIR}/IdiBusSlave/RSLink.o ${OBJECTDIR}/IdiBusSlave/USART1.o ${OBJECTDIR}/Required/AES.o ${OBJECTDIR}/Required/CRCs.o ${OBJECTDIR}/Required/System.o
# Source Files
SOURCEFILES=Bootloader/idibus_hw.c Bootloader/main.c Components/bootFunctions.c IdiBusSlave/MEMORY.c IdiBusSlave/RSLink.c IdiBusSlave/USART1.c Required/AES.c Required/CRCs.c Required/System.c
# Pack Options
PACK_COMPILER_OPTIONS=-I "${DFP_DIR}/include"
PACK_COMMON_OPTIONS=-B "${DFP_DIR}/gcc/dev/atmega1280"
CFLAGS=
ASFLAGS=
LDLIBSOPTIONS=
############# Tool locations ##########################################
# If you copy a project from one host to another, the path where the #
# compiler is installed may be different. #
# If you open this project with MPLAB X in the new host, this #
# makefile will be regenerated and the paths will be corrected. #
#######################################################################
# fixDeps replaces a bunch of sed/cat/printf statements that slow down the build
FIXDEPS=fixDeps
.build-conf: ${BUILD_SUBPROJECTS}
ifneq ($(INFORMATION_MESSAGE), )
@echo $(INFORMATION_MESSAGE)
endif
${MAKE} -f nbproject/Makefile-ATMega1280.mk ${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
MP_PROCESSOR_OPTION=ATmega1280
# ------------------------------------------------------------------------------------
# Rules for buildStep: assemble
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
else
endif
# ------------------------------------------------------------------------------------
# Rules for buildStep: assembleWithPreprocess
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
else
endif
# ------------------------------------------------------------------------------------
# Rules for buildStep: compile
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
${OBJECTDIR}/Bootloader/idibus_hw.o: Bootloader/idibus_hw.c .generated_files/flags/ATMega1280/1741ca773f9d6c9200d3a790ad45e96c5829c640 .generated_files/flags/ATMega1280/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Bootloader"
@${RM} ${OBJECTDIR}/Bootloader/idibus_hw.o.d
@${RM} ${OBJECTDIR}/Bootloader/idibus_hw.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Bootloader/idibus_hw.o.d" -MT "${OBJECTDIR}/Bootloader/idibus_hw.o.d" -MT ${OBJECTDIR}/Bootloader/idibus_hw.o -o ${OBJECTDIR}/Bootloader/idibus_hw.o Bootloader/idibus_hw.c -DXPRJ_ATMega1280=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Bootloader/main.o: Bootloader/main.c .generated_files/flags/ATMega1280/bb655dbc1061401470f0f566876f7026e5ace499 .generated_files/flags/ATMega1280/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Bootloader"
@${RM} ${OBJECTDIR}/Bootloader/main.o.d
@${RM} ${OBJECTDIR}/Bootloader/main.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Bootloader/main.o.d" -MT "${OBJECTDIR}/Bootloader/main.o.d" -MT ${OBJECTDIR}/Bootloader/main.o -o ${OBJECTDIR}/Bootloader/main.o Bootloader/main.c -DXPRJ_ATMega1280=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Components/bootFunctions.o: Components/bootFunctions.c .generated_files/flags/ATMega1280/1f5cc1c7be8f81d4f303661f0aaae78529317e95 .generated_files/flags/ATMega1280/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Components"
@${RM} ${OBJECTDIR}/Components/bootFunctions.o.d
@${RM} ${OBJECTDIR}/Components/bootFunctions.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Components/bootFunctions.o.d" -MT "${OBJECTDIR}/Components/bootFunctions.o.d" -MT ${OBJECTDIR}/Components/bootFunctions.o -o ${OBJECTDIR}/Components/bootFunctions.o Components/bootFunctions.c -DXPRJ_ATMega1280=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusSlave/MEMORY.o: IdiBusSlave/MEMORY.c .generated_files/flags/ATMega1280/c23eb7cc2c8b0f1ceee86356557595059d31af89 .generated_files/flags/ATMega1280/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusSlave"
@${RM} ${OBJECTDIR}/IdiBusSlave/MEMORY.o.d
@${RM} ${OBJECTDIR}/IdiBusSlave/MEMORY.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave/MEMORY.o.d" -MT "${OBJECTDIR}/IdiBusSlave/MEMORY.o.d" -MT ${OBJECTDIR}/IdiBusSlave/MEMORY.o -o ${OBJECTDIR}/IdiBusSlave/MEMORY.o IdiBusSlave/MEMORY.c -DXPRJ_ATMega1280=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusSlave/RSLink.o: IdiBusSlave/RSLink.c .generated_files/flags/ATMega1280/9198634f3341b68f2052786c76cdf7dcd509cfb7 .generated_files/flags/ATMega1280/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusSlave"
@${RM} ${OBJECTDIR}/IdiBusSlave/RSLink.o.d
@${RM} ${OBJECTDIR}/IdiBusSlave/RSLink.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave/RSLink.o.d" -MT "${OBJECTDIR}/IdiBusSlave/RSLink.o.d" -MT ${OBJECTDIR}/IdiBusSlave/RSLink.o -o ${OBJECTDIR}/IdiBusSlave/RSLink.o IdiBusSlave/RSLink.c -DXPRJ_ATMega1280=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusSlave/USART1.o: IdiBusSlave/USART1.c .generated_files/flags/ATMega1280/7bfb78fa34859e278d75f0fd7ed326cdc377e24e .generated_files/flags/ATMega1280/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusSlave"
@${RM} ${OBJECTDIR}/IdiBusSlave/USART1.o.d
@${RM} ${OBJECTDIR}/IdiBusSlave/USART1.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave/USART1.o.d" -MT "${OBJECTDIR}/IdiBusSlave/USART1.o.d" -MT ${OBJECTDIR}/IdiBusSlave/USART1.o -o ${OBJECTDIR}/IdiBusSlave/USART1.o IdiBusSlave/USART1.c -DXPRJ_ATMega1280=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Required/AES.o: Required/AES.c .generated_files/flags/ATMega1280/ca5c4f49b4464a0aea7259dd5aa97bd0815071c3 .generated_files/flags/ATMega1280/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Required"
@${RM} ${OBJECTDIR}/Required/AES.o.d
@${RM} ${OBJECTDIR}/Required/AES.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Required/AES.o.d" -MT "${OBJECTDIR}/Required/AES.o.d" -MT ${OBJECTDIR}/Required/AES.o -o ${OBJECTDIR}/Required/AES.o Required/AES.c -DXPRJ_ATMega1280=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Required/CRCs.o: Required/CRCs.c .generated_files/flags/ATMega1280/7807eb644b23d76c42e80ca3902eba9da590a183 .generated_files/flags/ATMega1280/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Required"
@${RM} ${OBJECTDIR}/Required/CRCs.o.d
@${RM} ${OBJECTDIR}/Required/CRCs.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Required/CRCs.o.d" -MT "${OBJECTDIR}/Required/CRCs.o.d" -MT ${OBJECTDIR}/Required/CRCs.o -o ${OBJECTDIR}/Required/CRCs.o Required/CRCs.c -DXPRJ_ATMega1280=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Required/System.o: Required/System.c .generated_files/flags/ATMega1280/46eb75c9563df5dcd097801af28730cad0445496 .generated_files/flags/ATMega1280/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Required"
@${RM} ${OBJECTDIR}/Required/System.o.d
@${RM} ${OBJECTDIR}/Required/System.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Required/System.o.d" -MT "${OBJECTDIR}/Required/System.o.d" -MT ${OBJECTDIR}/Required/System.o -o ${OBJECTDIR}/Required/System.o Required/System.c -DXPRJ_ATMega1280=$(CND_CONF) $(COMPARISON_BUILD)
else
${OBJECTDIR}/Bootloader/idibus_hw.o: Bootloader/idibus_hw.c .generated_files/flags/ATMega1280/eb2b2c413412e7471de5307f9c6d5f0f9bf4fa87 .generated_files/flags/ATMega1280/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Bootloader"
@${RM} ${OBJECTDIR}/Bootloader/idibus_hw.o.d
@${RM} ${OBJECTDIR}/Bootloader/idibus_hw.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Bootloader/idibus_hw.o.d" -MT "${OBJECTDIR}/Bootloader/idibus_hw.o.d" -MT ${OBJECTDIR}/Bootloader/idibus_hw.o -o ${OBJECTDIR}/Bootloader/idibus_hw.o Bootloader/idibus_hw.c -DXPRJ_ATMega1280=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Bootloader/main.o: Bootloader/main.c .generated_files/flags/ATMega1280/2f774ef7e8c3913fb00c2d2556c8470a7f759334 .generated_files/flags/ATMega1280/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Bootloader"
@${RM} ${OBJECTDIR}/Bootloader/main.o.d
@${RM} ${OBJECTDIR}/Bootloader/main.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Bootloader/main.o.d" -MT "${OBJECTDIR}/Bootloader/main.o.d" -MT ${OBJECTDIR}/Bootloader/main.o -o ${OBJECTDIR}/Bootloader/main.o Bootloader/main.c -DXPRJ_ATMega1280=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Components/bootFunctions.o: Components/bootFunctions.c .generated_files/flags/ATMega1280/8358bfa9d61e5b7a8f372ab420623fd9d2f4767d .generated_files/flags/ATMega1280/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Components"
@${RM} ${OBJECTDIR}/Components/bootFunctions.o.d
@${RM} ${OBJECTDIR}/Components/bootFunctions.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Components/bootFunctions.o.d" -MT "${OBJECTDIR}/Components/bootFunctions.o.d" -MT ${OBJECTDIR}/Components/bootFunctions.o -o ${OBJECTDIR}/Components/bootFunctions.o Components/bootFunctions.c -DXPRJ_ATMega1280=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusSlave/MEMORY.o: IdiBusSlave/MEMORY.c .generated_files/flags/ATMega1280/af13cfcee2e53a4bbc5d076f457a7813e33ecf81 .generated_files/flags/ATMega1280/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusSlave"
@${RM} ${OBJECTDIR}/IdiBusSlave/MEMORY.o.d
@${RM} ${OBJECTDIR}/IdiBusSlave/MEMORY.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave/MEMORY.o.d" -MT "${OBJECTDIR}/IdiBusSlave/MEMORY.o.d" -MT ${OBJECTDIR}/IdiBusSlave/MEMORY.o -o ${OBJECTDIR}/IdiBusSlave/MEMORY.o IdiBusSlave/MEMORY.c -DXPRJ_ATMega1280=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusSlave/RSLink.o: IdiBusSlave/RSLink.c .generated_files/flags/ATMega1280/4e52b70d1f08e3ea705418e94a36f913283f24b2 .generated_files/flags/ATMega1280/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusSlave"
@${RM} ${OBJECTDIR}/IdiBusSlave/RSLink.o.d
@${RM} ${OBJECTDIR}/IdiBusSlave/RSLink.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave/RSLink.o.d" -MT "${OBJECTDIR}/IdiBusSlave/RSLink.o.d" -MT ${OBJECTDIR}/IdiBusSlave/RSLink.o -o ${OBJECTDIR}/IdiBusSlave/RSLink.o IdiBusSlave/RSLink.c -DXPRJ_ATMega1280=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusSlave/USART1.o: IdiBusSlave/USART1.c .generated_files/flags/ATMega1280/82515b4fd15cec20d8517fb8f53c1592e2ecb37b .generated_files/flags/ATMega1280/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusSlave"
@${RM} ${OBJECTDIR}/IdiBusSlave/USART1.o.d
@${RM} ${OBJECTDIR}/IdiBusSlave/USART1.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave/USART1.o.d" -MT "${OBJECTDIR}/IdiBusSlave/USART1.o.d" -MT ${OBJECTDIR}/IdiBusSlave/USART1.o -o ${OBJECTDIR}/IdiBusSlave/USART1.o IdiBusSlave/USART1.c -DXPRJ_ATMega1280=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Required/AES.o: Required/AES.c .generated_files/flags/ATMega1280/52fa2dd4dcb195f90616e93cbd35c43b2883c916 .generated_files/flags/ATMega1280/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Required"
@${RM} ${OBJECTDIR}/Required/AES.o.d
@${RM} ${OBJECTDIR}/Required/AES.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Required/AES.o.d" -MT "${OBJECTDIR}/Required/AES.o.d" -MT ${OBJECTDIR}/Required/AES.o -o ${OBJECTDIR}/Required/AES.o Required/AES.c -DXPRJ_ATMega1280=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Required/CRCs.o: Required/CRCs.c .generated_files/flags/ATMega1280/2c8299a0711d540a4d32ddba361d48c263ef24c8 .generated_files/flags/ATMega1280/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Required"
@${RM} ${OBJECTDIR}/Required/CRCs.o.d
@${RM} ${OBJECTDIR}/Required/CRCs.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Required/CRCs.o.d" -MT "${OBJECTDIR}/Required/CRCs.o.d" -MT ${OBJECTDIR}/Required/CRCs.o -o ${OBJECTDIR}/Required/CRCs.o Required/CRCs.c -DXPRJ_ATMega1280=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Required/System.o: Required/System.c .generated_files/flags/ATMega1280/43dbe3e4149c088453c32bc14289d3ea71740718 .generated_files/flags/ATMega1280/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Required"
@${RM} ${OBJECTDIR}/Required/System.o.d
@${RM} ${OBJECTDIR}/Required/System.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Required/System.o.d" -MT "${OBJECTDIR}/Required/System.o.d" -MT ${OBJECTDIR}/Required/System.o -o ${OBJECTDIR}/Required/System.o Required/System.c -DXPRJ_ATMega1280=$(CND_CONF) $(COMPARISON_BUILD)
endif
# ------------------------------------------------------------------------------------
# Rules for buildStep: compileCPP
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
else
endif
# ------------------------------------------------------------------------------------
# Rules for buildStep: link
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${DISTDIR}
${MP_CC} $(MP_EXTRA_LD_PRE) -mmcu=atmega1280 ${PACK_COMMON_OPTIONS} -gdwarf-2 -D__$(MP_PROCESSOR_OPTION)__ -Wl,-Map="${DISTDIR}\idibusslavebootloader.${IMAGE_TYPE}.map" -Wl,-section-start=.locationInApp=0x1df00 -Wl,-section-start=.text=0x1e000 -Wl,-section-start=.locationInBoot=0x1ff00 -o ${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${OUTPUT_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -DXPRJ_ATMega1280=$(CND_CONF) $(COMPARISON_BUILD) -Wl,--defsym=__MPLAB_BUILD=1$(MP_EXTRA_LD_POST)$(MP_LINKER_FILE_OPTION),--defsym=__ICD2RAM=1,--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1 -Wl,--gc-sections -Wl,--start-group -Wl,-lm -Wl,--end-group
else
${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${DISTDIR}
${MP_CC} $(MP_EXTRA_LD_PRE) -mmcu=atmega1280 ${PACK_COMMON_OPTIONS} -D__$(MP_PROCESSOR_OPTION)__ -Wl,-Map="${DISTDIR}\idibusslavebootloader.${IMAGE_TYPE}.map" -Wl,-section-start=.locationInApp=0x1df00 -Wl,-section-start=.text=0x1e000 -Wl,-section-start=.locationInBoot=0x1ff00 -o ${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -DXPRJ_ATMega1280=$(CND_CONF) $(COMPARISON_BUILD) -Wl,--defsym=__MPLAB_BUILD=1$(MP_EXTRA_LD_POST)$(MP_LINKER_FILE_OPTION) -Wl,--gc-sections -Wl,--start-group -Wl,-lm -Wl,--end-group
${MP_CC_DIR}\\avr-objcopy -O ihex "${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX}" "${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.hex"
endif
# Subprojects
.build-subprojects:
# Subprojects
.clean-subprojects:
# Clean Targets
.clean-conf: ${CLEAN_SUBPROJECTS}
${RM} -r ${OBJECTDIR}
${RM} -r ${DISTDIR}
# Enable dependency checking
.dep.inc: .depcheck-impl
DEPFILES=$(wildcard ${POSSIBLE_DEPFILES})
ifneq (${DEPFILES},)
include ${DEPFILES}
endif

@ -0,0 +1,267 @@
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a -pre and a -post target defined where you can add customized code.
#
# This makefile implements configuration specific macros and targets.
# Include project Makefile
ifeq "${IGNORE_LOCAL}" "TRUE"
# do not include local makefile. User is passing all local related variables already
else
include Makefile
# Include makefile containing local settings
ifeq "$(wildcard nbproject/Makefile-local-ATMega2560.mk)" "nbproject/Makefile-local-ATMega2560.mk"
include nbproject/Makefile-local-ATMega2560.mk
endif
endif
# Environment
MKDIR=gnumkdir -p
RM=rm -f
MV=mv
CP=cp
# Macros
CND_CONF=ATMega2560
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
IMAGE_TYPE=debug
OUTPUT_SUFFIX=elf
DEBUGGABLE_SUFFIX=elf
FINAL_IMAGE=${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
else
IMAGE_TYPE=production
OUTPUT_SUFFIX=hex
DEBUGGABLE_SUFFIX=elf
FINAL_IMAGE=${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
endif
ifeq ($(COMPARE_BUILD), true)
COMPARISON_BUILD=
else
COMPARISON_BUILD=
endif
# Object Directory
OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE}
# Distribution Directory
DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE}
# Source Files Quoted if spaced
SOURCEFILES_QUOTED_IF_SPACED=Bootloader/idibus_hw.c Bootloader/main.c Components/bootFunctions.c IdiBusSlave/MEMORY.c IdiBusSlave/RSLink.c IdiBusSlave/USART1.c Required/AES.c Required/CRCs.c Required/System.c
# Object Files Quoted if spaced
OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/Bootloader/idibus_hw.o ${OBJECTDIR}/Bootloader/main.o ${OBJECTDIR}/Components/bootFunctions.o ${OBJECTDIR}/IdiBusSlave/MEMORY.o ${OBJECTDIR}/IdiBusSlave/RSLink.o ${OBJECTDIR}/IdiBusSlave/USART1.o ${OBJECTDIR}/Required/AES.o ${OBJECTDIR}/Required/CRCs.o ${OBJECTDIR}/Required/System.o
POSSIBLE_DEPFILES=${OBJECTDIR}/Bootloader/idibus_hw.o.d ${OBJECTDIR}/Bootloader/main.o.d ${OBJECTDIR}/Components/bootFunctions.o.d ${OBJECTDIR}/IdiBusSlave/MEMORY.o.d ${OBJECTDIR}/IdiBusSlave/RSLink.o.d ${OBJECTDIR}/IdiBusSlave/USART1.o.d ${OBJECTDIR}/Required/AES.o.d ${OBJECTDIR}/Required/CRCs.o.d ${OBJECTDIR}/Required/System.o.d
# Object Files
OBJECTFILES=${OBJECTDIR}/Bootloader/idibus_hw.o ${OBJECTDIR}/Bootloader/main.o ${OBJECTDIR}/Components/bootFunctions.o ${OBJECTDIR}/IdiBusSlave/MEMORY.o ${OBJECTDIR}/IdiBusSlave/RSLink.o ${OBJECTDIR}/IdiBusSlave/USART1.o ${OBJECTDIR}/Required/AES.o ${OBJECTDIR}/Required/CRCs.o ${OBJECTDIR}/Required/System.o
# Source Files
SOURCEFILES=Bootloader/idibus_hw.c Bootloader/main.c Components/bootFunctions.c IdiBusSlave/MEMORY.c IdiBusSlave/RSLink.c IdiBusSlave/USART1.c Required/AES.c Required/CRCs.c Required/System.c
# Pack Options
PACK_COMPILER_OPTIONS=-I "${DFP_DIR}/include"
PACK_COMMON_OPTIONS=-B "${DFP_DIR}/gcc/dev/atmega2560"
CFLAGS=
ASFLAGS=
LDLIBSOPTIONS=
############# Tool locations ##########################################
# If you copy a project from one host to another, the path where the #
# compiler is installed may be different. #
# If you open this project with MPLAB X in the new host, this #
# makefile will be regenerated and the paths will be corrected. #
#######################################################################
# fixDeps replaces a bunch of sed/cat/printf statements that slow down the build
FIXDEPS=fixDeps
.build-conf: ${BUILD_SUBPROJECTS}
ifneq ($(INFORMATION_MESSAGE), )
@echo $(INFORMATION_MESSAGE)
endif
${MAKE} -f nbproject/Makefile-ATMega2560.mk ${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
MP_PROCESSOR_OPTION=ATmega2560
# ------------------------------------------------------------------------------------
# Rules for buildStep: assemble
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
else
endif
# ------------------------------------------------------------------------------------
# Rules for buildStep: assembleWithPreprocess
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
else
endif
# ------------------------------------------------------------------------------------
# Rules for buildStep: compile
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
${OBJECTDIR}/Bootloader/idibus_hw.o: Bootloader/idibus_hw.c .generated_files/flags/ATMega2560/25c56708c249e9e9e484b27e62d9e5caba6d7d36 .generated_files/flags/ATMega2560/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Bootloader"
@${RM} ${OBJECTDIR}/Bootloader/idibus_hw.o.d
@${RM} ${OBJECTDIR}/Bootloader/idibus_hw.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega2560 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Bootloader/idibus_hw.o.d" -MT "${OBJECTDIR}/Bootloader/idibus_hw.o.d" -MT ${OBJECTDIR}/Bootloader/idibus_hw.o -o ${OBJECTDIR}/Bootloader/idibus_hw.o Bootloader/idibus_hw.c -DXPRJ_ATMega2560=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Bootloader/main.o: Bootloader/main.c .generated_files/flags/ATMega2560/e12f94669c96e7c00dabc5119b403a1b947fdd37 .generated_files/flags/ATMega2560/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Bootloader"
@${RM} ${OBJECTDIR}/Bootloader/main.o.d
@${RM} ${OBJECTDIR}/Bootloader/main.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega2560 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Bootloader/main.o.d" -MT "${OBJECTDIR}/Bootloader/main.o.d" -MT ${OBJECTDIR}/Bootloader/main.o -o ${OBJECTDIR}/Bootloader/main.o Bootloader/main.c -DXPRJ_ATMega2560=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Components/bootFunctions.o: Components/bootFunctions.c .generated_files/flags/ATMega2560/3f8c5d818a888788b0f2dbbdc71e53c376aa37ca .generated_files/flags/ATMega2560/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Components"
@${RM} ${OBJECTDIR}/Components/bootFunctions.o.d
@${RM} ${OBJECTDIR}/Components/bootFunctions.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega2560 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Components/bootFunctions.o.d" -MT "${OBJECTDIR}/Components/bootFunctions.o.d" -MT ${OBJECTDIR}/Components/bootFunctions.o -o ${OBJECTDIR}/Components/bootFunctions.o Components/bootFunctions.c -DXPRJ_ATMega2560=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusSlave/MEMORY.o: IdiBusSlave/MEMORY.c .generated_files/flags/ATMega2560/22f675585e6797e10244f5f0999b3d725cdc9571 .generated_files/flags/ATMega2560/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusSlave"
@${RM} ${OBJECTDIR}/IdiBusSlave/MEMORY.o.d
@${RM} ${OBJECTDIR}/IdiBusSlave/MEMORY.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega2560 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave/MEMORY.o.d" -MT "${OBJECTDIR}/IdiBusSlave/MEMORY.o.d" -MT ${OBJECTDIR}/IdiBusSlave/MEMORY.o -o ${OBJECTDIR}/IdiBusSlave/MEMORY.o IdiBusSlave/MEMORY.c -DXPRJ_ATMega2560=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusSlave/RSLink.o: IdiBusSlave/RSLink.c .generated_files/flags/ATMega2560/a32467600a0479cba712296608d084e119cb28ad .generated_files/flags/ATMega2560/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusSlave"
@${RM} ${OBJECTDIR}/IdiBusSlave/RSLink.o.d
@${RM} ${OBJECTDIR}/IdiBusSlave/RSLink.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega2560 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave/RSLink.o.d" -MT "${OBJECTDIR}/IdiBusSlave/RSLink.o.d" -MT ${OBJECTDIR}/IdiBusSlave/RSLink.o -o ${OBJECTDIR}/IdiBusSlave/RSLink.o IdiBusSlave/RSLink.c -DXPRJ_ATMega2560=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusSlave/USART1.o: IdiBusSlave/USART1.c .generated_files/flags/ATMega2560/2f81a091662e6f6c0c354ccce746e36f155f4968 .generated_files/flags/ATMega2560/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusSlave"
@${RM} ${OBJECTDIR}/IdiBusSlave/USART1.o.d
@${RM} ${OBJECTDIR}/IdiBusSlave/USART1.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega2560 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave/USART1.o.d" -MT "${OBJECTDIR}/IdiBusSlave/USART1.o.d" -MT ${OBJECTDIR}/IdiBusSlave/USART1.o -o ${OBJECTDIR}/IdiBusSlave/USART1.o IdiBusSlave/USART1.c -DXPRJ_ATMega2560=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Required/AES.o: Required/AES.c .generated_files/flags/ATMega2560/f7d20fe6eb6135a249d26b112117a40f82cd11b2 .generated_files/flags/ATMega2560/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Required"
@${RM} ${OBJECTDIR}/Required/AES.o.d
@${RM} ${OBJECTDIR}/Required/AES.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega2560 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Required/AES.o.d" -MT "${OBJECTDIR}/Required/AES.o.d" -MT ${OBJECTDIR}/Required/AES.o -o ${OBJECTDIR}/Required/AES.o Required/AES.c -DXPRJ_ATMega2560=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Required/CRCs.o: Required/CRCs.c .generated_files/flags/ATMega2560/c335f70b1c27e393acf8fcc231650bd2add596d4 .generated_files/flags/ATMega2560/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Required"
@${RM} ${OBJECTDIR}/Required/CRCs.o.d
@${RM} ${OBJECTDIR}/Required/CRCs.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega2560 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Required/CRCs.o.d" -MT "${OBJECTDIR}/Required/CRCs.o.d" -MT ${OBJECTDIR}/Required/CRCs.o -o ${OBJECTDIR}/Required/CRCs.o Required/CRCs.c -DXPRJ_ATMega2560=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Required/System.o: Required/System.c .generated_files/flags/ATMega2560/6885449a26d9b6aaa52b47a2f83afc1c63d3b2a7 .generated_files/flags/ATMega2560/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Required"
@${RM} ${OBJECTDIR}/Required/System.o.d
@${RM} ${OBJECTDIR}/Required/System.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega2560 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Required/System.o.d" -MT "${OBJECTDIR}/Required/System.o.d" -MT ${OBJECTDIR}/Required/System.o -o ${OBJECTDIR}/Required/System.o Required/System.c -DXPRJ_ATMega2560=$(CND_CONF) $(COMPARISON_BUILD)
else
${OBJECTDIR}/Bootloader/idibus_hw.o: Bootloader/idibus_hw.c .generated_files/flags/ATMega2560/9d2ac0662e451a80e2b5dd9b0ce179cefd561fb0 .generated_files/flags/ATMega2560/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Bootloader"
@${RM} ${OBJECTDIR}/Bootloader/idibus_hw.o.d
@${RM} ${OBJECTDIR}/Bootloader/idibus_hw.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega2560 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Bootloader/idibus_hw.o.d" -MT "${OBJECTDIR}/Bootloader/idibus_hw.o.d" -MT ${OBJECTDIR}/Bootloader/idibus_hw.o -o ${OBJECTDIR}/Bootloader/idibus_hw.o Bootloader/idibus_hw.c -DXPRJ_ATMega2560=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Bootloader/main.o: Bootloader/main.c .generated_files/flags/ATMega2560/292e8d974773aa2e41bed209400cca965ccd577 .generated_files/flags/ATMega2560/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Bootloader"
@${RM} ${OBJECTDIR}/Bootloader/main.o.d
@${RM} ${OBJECTDIR}/Bootloader/main.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega2560 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Bootloader/main.o.d" -MT "${OBJECTDIR}/Bootloader/main.o.d" -MT ${OBJECTDIR}/Bootloader/main.o -o ${OBJECTDIR}/Bootloader/main.o Bootloader/main.c -DXPRJ_ATMega2560=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Components/bootFunctions.o: Components/bootFunctions.c .generated_files/flags/ATMega2560/abad0eabf22c93c8c961c9c5b7b76b8316d122c6 .generated_files/flags/ATMega2560/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Components"
@${RM} ${OBJECTDIR}/Components/bootFunctions.o.d
@${RM} ${OBJECTDIR}/Components/bootFunctions.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega2560 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Components/bootFunctions.o.d" -MT "${OBJECTDIR}/Components/bootFunctions.o.d" -MT ${OBJECTDIR}/Components/bootFunctions.o -o ${OBJECTDIR}/Components/bootFunctions.o Components/bootFunctions.c -DXPRJ_ATMega2560=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusSlave/MEMORY.o: IdiBusSlave/MEMORY.c .generated_files/flags/ATMega2560/c90f1d57f1e2feb28a2731147967091df2aef81e .generated_files/flags/ATMega2560/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusSlave"
@${RM} ${OBJECTDIR}/IdiBusSlave/MEMORY.o.d
@${RM} ${OBJECTDIR}/IdiBusSlave/MEMORY.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega2560 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave/MEMORY.o.d" -MT "${OBJECTDIR}/IdiBusSlave/MEMORY.o.d" -MT ${OBJECTDIR}/IdiBusSlave/MEMORY.o -o ${OBJECTDIR}/IdiBusSlave/MEMORY.o IdiBusSlave/MEMORY.c -DXPRJ_ATMega2560=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusSlave/RSLink.o: IdiBusSlave/RSLink.c .generated_files/flags/ATMega2560/421d0aa366b38a6afcf2985f236152b650e11773 .generated_files/flags/ATMega2560/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusSlave"
@${RM} ${OBJECTDIR}/IdiBusSlave/RSLink.o.d
@${RM} ${OBJECTDIR}/IdiBusSlave/RSLink.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega2560 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave/RSLink.o.d" -MT "${OBJECTDIR}/IdiBusSlave/RSLink.o.d" -MT ${OBJECTDIR}/IdiBusSlave/RSLink.o -o ${OBJECTDIR}/IdiBusSlave/RSLink.o IdiBusSlave/RSLink.c -DXPRJ_ATMega2560=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusSlave/USART1.o: IdiBusSlave/USART1.c .generated_files/flags/ATMega2560/f0b04006b3e0e4028d47b00065c9a7bff9952b2e .generated_files/flags/ATMega2560/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusSlave"
@${RM} ${OBJECTDIR}/IdiBusSlave/USART1.o.d
@${RM} ${OBJECTDIR}/IdiBusSlave/USART1.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega2560 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave/USART1.o.d" -MT "${OBJECTDIR}/IdiBusSlave/USART1.o.d" -MT ${OBJECTDIR}/IdiBusSlave/USART1.o -o ${OBJECTDIR}/IdiBusSlave/USART1.o IdiBusSlave/USART1.c -DXPRJ_ATMega2560=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Required/AES.o: Required/AES.c .generated_files/flags/ATMega2560/edb4bb4e01b6b26745d04b2029261fada685fd66 .generated_files/flags/ATMega2560/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Required"
@${RM} ${OBJECTDIR}/Required/AES.o.d
@${RM} ${OBJECTDIR}/Required/AES.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega2560 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Required/AES.o.d" -MT "${OBJECTDIR}/Required/AES.o.d" -MT ${OBJECTDIR}/Required/AES.o -o ${OBJECTDIR}/Required/AES.o Required/AES.c -DXPRJ_ATMega2560=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Required/CRCs.o: Required/CRCs.c .generated_files/flags/ATMega2560/a98bb7a02d19091c08b455f57193f17da127792f .generated_files/flags/ATMega2560/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Required"
@${RM} ${OBJECTDIR}/Required/CRCs.o.d
@${RM} ${OBJECTDIR}/Required/CRCs.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega2560 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Required/CRCs.o.d" -MT "${OBJECTDIR}/Required/CRCs.o.d" -MT ${OBJECTDIR}/Required/CRCs.o -o ${OBJECTDIR}/Required/CRCs.o Required/CRCs.c -DXPRJ_ATMega2560=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Required/System.o: Required/System.c .generated_files/flags/ATMega2560/e17b9950467f46f29ef30fe54753a01ee4316f9f .generated_files/flags/ATMega2560/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Required"
@${RM} ${OBJECTDIR}/Required/System.o.d
@${RM} ${OBJECTDIR}/Required/System.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega2560 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Required/System.o.d" -MT "${OBJECTDIR}/Required/System.o.d" -MT ${OBJECTDIR}/Required/System.o -o ${OBJECTDIR}/Required/System.o Required/System.c -DXPRJ_ATMega2560=$(CND_CONF) $(COMPARISON_BUILD)
endif
# ------------------------------------------------------------------------------------
# Rules for buildStep: compileCPP
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
else
endif
# ------------------------------------------------------------------------------------
# Rules for buildStep: link
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${DISTDIR}
${MP_CC} $(MP_EXTRA_LD_PRE) -mmcu=atmega2560 ${PACK_COMMON_OPTIONS} -gdwarf-2 -D__$(MP_PROCESSOR_OPTION)__ -Wl,-Map="${DISTDIR}\idibusslavebootloader.${IMAGE_TYPE}.map" -Wl,-section-start=.locationInApp=0x3df00 -Wl,-section-start=.text=0x3e000 -Wl,-section-start=.locationInBoot=0x3ff00 -o ${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${OUTPUT_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -DXPRJ_ATMega2560=$(CND_CONF) $(COMPARISON_BUILD) -Wl,--defsym=__MPLAB_BUILD=1$(MP_EXTRA_LD_POST)$(MP_LINKER_FILE_OPTION),--defsym=__ICD2RAM=1,--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1 -Wl,--gc-sections -Wl,--start-group -Wl,-lm -Wl,--end-group
else
${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${DISTDIR}
${MP_CC} $(MP_EXTRA_LD_PRE) -mmcu=atmega2560 ${PACK_COMMON_OPTIONS} -D__$(MP_PROCESSOR_OPTION)__ -Wl,-Map="${DISTDIR}\idibusslavebootloader.${IMAGE_TYPE}.map" -Wl,-section-start=.locationInApp=0x3df00 -Wl,-section-start=.text=0x3e000 -Wl,-section-start=.locationInBoot=0x3ff00 -o ${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -DXPRJ_ATMega2560=$(CND_CONF) $(COMPARISON_BUILD) -Wl,--defsym=__MPLAB_BUILD=1$(MP_EXTRA_LD_POST)$(MP_LINKER_FILE_OPTION) -Wl,--gc-sections -Wl,--start-group -Wl,-lm -Wl,--end-group
${MP_CC_DIR}\\avr-objcopy -O ihex "${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX}" "${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.hex"
endif
# Subprojects
.build-subprojects:
# Subprojects
.clean-subprojects:
# Clean Targets
.clean-conf: ${CLEAN_SUBPROJECTS}
${RM} -r ${OBJECTDIR}
${RM} -r ${DISTDIR}
# Enable dependency checking
.dep.inc: .depcheck-impl
DEPFILES=$(wildcard ${POSSIBLE_DEPFILES})
ifneq (${DEPFILES},)
include ${DEPFILES}
endif

@ -0,0 +1,267 @@
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a -pre and a -post target defined where you can add customized code.
#
# This makefile implements configuration specific macros and targets.
# Include project Makefile
ifeq "${IGNORE_LOCAL}" "TRUE"
# do not include local makefile. User is passing all local related variables already
else
include Makefile
# Include makefile containing local settings
ifeq "$(wildcard nbproject/Makefile-local-ATMega328PB.mk)" "nbproject/Makefile-local-ATMega328PB.mk"
include nbproject/Makefile-local-ATMega328PB.mk
endif
endif
# Environment
MKDIR=gnumkdir -p
RM=rm -f
MV=mv
CP=cp
# Macros
CND_CONF=ATMega328PB
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
IMAGE_TYPE=debug
OUTPUT_SUFFIX=elf
DEBUGGABLE_SUFFIX=elf
FINAL_IMAGE=${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
else
IMAGE_TYPE=production
OUTPUT_SUFFIX=hex
DEBUGGABLE_SUFFIX=elf
FINAL_IMAGE=${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
endif
ifeq ($(COMPARE_BUILD), true)
COMPARISON_BUILD=
else
COMPARISON_BUILD=
endif
# Object Directory
OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE}
# Distribution Directory
DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE}
# Source Files Quoted if spaced
SOURCEFILES_QUOTED_IF_SPACED=Bootloader/idibus_hw.c Bootloader/main.c Components/bootFunctions.c IdiBusSlave/MEMORY.c IdiBusSlave/RSLink.c IdiBusSlave/USART1.c Required/AES.c Required/CRCs.c Required/System.c
# Object Files Quoted if spaced
OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/Bootloader/idibus_hw.o ${OBJECTDIR}/Bootloader/main.o ${OBJECTDIR}/Components/bootFunctions.o ${OBJECTDIR}/IdiBusSlave/MEMORY.o ${OBJECTDIR}/IdiBusSlave/RSLink.o ${OBJECTDIR}/IdiBusSlave/USART1.o ${OBJECTDIR}/Required/AES.o ${OBJECTDIR}/Required/CRCs.o ${OBJECTDIR}/Required/System.o
POSSIBLE_DEPFILES=${OBJECTDIR}/Bootloader/idibus_hw.o.d ${OBJECTDIR}/Bootloader/main.o.d ${OBJECTDIR}/Components/bootFunctions.o.d ${OBJECTDIR}/IdiBusSlave/MEMORY.o.d ${OBJECTDIR}/IdiBusSlave/RSLink.o.d ${OBJECTDIR}/IdiBusSlave/USART1.o.d ${OBJECTDIR}/Required/AES.o.d ${OBJECTDIR}/Required/CRCs.o.d ${OBJECTDIR}/Required/System.o.d
# Object Files
OBJECTFILES=${OBJECTDIR}/Bootloader/idibus_hw.o ${OBJECTDIR}/Bootloader/main.o ${OBJECTDIR}/Components/bootFunctions.o ${OBJECTDIR}/IdiBusSlave/MEMORY.o ${OBJECTDIR}/IdiBusSlave/RSLink.o ${OBJECTDIR}/IdiBusSlave/USART1.o ${OBJECTDIR}/Required/AES.o ${OBJECTDIR}/Required/CRCs.o ${OBJECTDIR}/Required/System.o
# Source Files
SOURCEFILES=Bootloader/idibus_hw.c Bootloader/main.c Components/bootFunctions.c IdiBusSlave/MEMORY.c IdiBusSlave/RSLink.c IdiBusSlave/USART1.c Required/AES.c Required/CRCs.c Required/System.c
# Pack Options
PACK_COMPILER_OPTIONS=-I "${DFP_DIR}/include"
PACK_COMMON_OPTIONS=-B "${DFP_DIR}/gcc/dev/atmega328pb"
CFLAGS=
ASFLAGS=
LDLIBSOPTIONS=
############# Tool locations ##########################################
# If you copy a project from one host to another, the path where the #
# compiler is installed may be different. #
# If you open this project with MPLAB X in the new host, this #
# makefile will be regenerated and the paths will be corrected. #
#######################################################################
# fixDeps replaces a bunch of sed/cat/printf statements that slow down the build
FIXDEPS=fixDeps
.build-conf: ${BUILD_SUBPROJECTS}
ifneq ($(INFORMATION_MESSAGE), )
@echo $(INFORMATION_MESSAGE)
endif
${MAKE} -f nbproject/Makefile-ATMega328PB.mk ${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
MP_PROCESSOR_OPTION=ATmega328PB
# ------------------------------------------------------------------------------------
# Rules for buildStep: assemble
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
else
endif
# ------------------------------------------------------------------------------------
# Rules for buildStep: assembleWithPreprocess
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
else
endif
# ------------------------------------------------------------------------------------
# Rules for buildStep: compile
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
${OBJECTDIR}/Bootloader/idibus_hw.o: Bootloader/idibus_hw.c .generated_files/flags/ATMega328PB/f99cf426c0c053ac445396e75f57120243006671 .generated_files/flags/ATMega328PB/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Bootloader"
@${RM} ${OBJECTDIR}/Bootloader/idibus_hw.o.d
@${RM} ${OBJECTDIR}/Bootloader/idibus_hw.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Bootloader/idibus_hw.o.d" -MT "${OBJECTDIR}/Bootloader/idibus_hw.o.d" -MT ${OBJECTDIR}/Bootloader/idibus_hw.o -o ${OBJECTDIR}/Bootloader/idibus_hw.o Bootloader/idibus_hw.c -DXPRJ_ATMega328PB=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Bootloader/main.o: Bootloader/main.c .generated_files/flags/ATMega328PB/8b4c73509bdacf025a6b6ee6afe9ef8bb0422d2 .generated_files/flags/ATMega328PB/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Bootloader"
@${RM} ${OBJECTDIR}/Bootloader/main.o.d
@${RM} ${OBJECTDIR}/Bootloader/main.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Bootloader/main.o.d" -MT "${OBJECTDIR}/Bootloader/main.o.d" -MT ${OBJECTDIR}/Bootloader/main.o -o ${OBJECTDIR}/Bootloader/main.o Bootloader/main.c -DXPRJ_ATMega328PB=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Components/bootFunctions.o: Components/bootFunctions.c .generated_files/flags/ATMega328PB/f0cd471de8def27dddf0f5400b9142202d43fe88 .generated_files/flags/ATMega328PB/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Components"
@${RM} ${OBJECTDIR}/Components/bootFunctions.o.d
@${RM} ${OBJECTDIR}/Components/bootFunctions.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Components/bootFunctions.o.d" -MT "${OBJECTDIR}/Components/bootFunctions.o.d" -MT ${OBJECTDIR}/Components/bootFunctions.o -o ${OBJECTDIR}/Components/bootFunctions.o Components/bootFunctions.c -DXPRJ_ATMega328PB=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusSlave/MEMORY.o: IdiBusSlave/MEMORY.c .generated_files/flags/ATMega328PB/2c5f376adfe8d966ac166f067878e1b040a53388 .generated_files/flags/ATMega328PB/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusSlave"
@${RM} ${OBJECTDIR}/IdiBusSlave/MEMORY.o.d
@${RM} ${OBJECTDIR}/IdiBusSlave/MEMORY.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave/MEMORY.o.d" -MT "${OBJECTDIR}/IdiBusSlave/MEMORY.o.d" -MT ${OBJECTDIR}/IdiBusSlave/MEMORY.o -o ${OBJECTDIR}/IdiBusSlave/MEMORY.o IdiBusSlave/MEMORY.c -DXPRJ_ATMega328PB=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusSlave/RSLink.o: IdiBusSlave/RSLink.c .generated_files/flags/ATMega328PB/916b30004b72f8ce1faac403b85e66d67e572475 .generated_files/flags/ATMega328PB/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusSlave"
@${RM} ${OBJECTDIR}/IdiBusSlave/RSLink.o.d
@${RM} ${OBJECTDIR}/IdiBusSlave/RSLink.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave/RSLink.o.d" -MT "${OBJECTDIR}/IdiBusSlave/RSLink.o.d" -MT ${OBJECTDIR}/IdiBusSlave/RSLink.o -o ${OBJECTDIR}/IdiBusSlave/RSLink.o IdiBusSlave/RSLink.c -DXPRJ_ATMega328PB=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusSlave/USART1.o: IdiBusSlave/USART1.c .generated_files/flags/ATMega328PB/5fac27ca93a4fde6d3bf33c0eaa5c2fe07153f9c .generated_files/flags/ATMega328PB/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusSlave"
@${RM} ${OBJECTDIR}/IdiBusSlave/USART1.o.d
@${RM} ${OBJECTDIR}/IdiBusSlave/USART1.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave/USART1.o.d" -MT "${OBJECTDIR}/IdiBusSlave/USART1.o.d" -MT ${OBJECTDIR}/IdiBusSlave/USART1.o -o ${OBJECTDIR}/IdiBusSlave/USART1.o IdiBusSlave/USART1.c -DXPRJ_ATMega328PB=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Required/AES.o: Required/AES.c .generated_files/flags/ATMega328PB/828b4b9d44f7055cd07e3f4860d8d4f3201cd8a8 .generated_files/flags/ATMega328PB/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Required"
@${RM} ${OBJECTDIR}/Required/AES.o.d
@${RM} ${OBJECTDIR}/Required/AES.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Required/AES.o.d" -MT "${OBJECTDIR}/Required/AES.o.d" -MT ${OBJECTDIR}/Required/AES.o -o ${OBJECTDIR}/Required/AES.o Required/AES.c -DXPRJ_ATMega328PB=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Required/CRCs.o: Required/CRCs.c .generated_files/flags/ATMega328PB/4befa5aaa5794cff8219fae84c77f19b8d730384 .generated_files/flags/ATMega328PB/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Required"
@${RM} ${OBJECTDIR}/Required/CRCs.o.d
@${RM} ${OBJECTDIR}/Required/CRCs.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Required/CRCs.o.d" -MT "${OBJECTDIR}/Required/CRCs.o.d" -MT ${OBJECTDIR}/Required/CRCs.o -o ${OBJECTDIR}/Required/CRCs.o Required/CRCs.c -DXPRJ_ATMega328PB=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Required/System.o: Required/System.c .generated_files/flags/ATMega328PB/7f3ee39388711310bfcafc420920e70e10ba9253 .generated_files/flags/ATMega328PB/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Required"
@${RM} ${OBJECTDIR}/Required/System.o.d
@${RM} ${OBJECTDIR}/Required/System.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Required/System.o.d" -MT "${OBJECTDIR}/Required/System.o.d" -MT ${OBJECTDIR}/Required/System.o -o ${OBJECTDIR}/Required/System.o Required/System.c -DXPRJ_ATMega328PB=$(CND_CONF) $(COMPARISON_BUILD)
else
${OBJECTDIR}/Bootloader/idibus_hw.o: Bootloader/idibus_hw.c .generated_files/flags/ATMega328PB/998dbebfb93d058e76a7f321d47ea184a2f5e8d7 .generated_files/flags/ATMega328PB/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Bootloader"
@${RM} ${OBJECTDIR}/Bootloader/idibus_hw.o.d
@${RM} ${OBJECTDIR}/Bootloader/idibus_hw.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Bootloader/idibus_hw.o.d" -MT "${OBJECTDIR}/Bootloader/idibus_hw.o.d" -MT ${OBJECTDIR}/Bootloader/idibus_hw.o -o ${OBJECTDIR}/Bootloader/idibus_hw.o Bootloader/idibus_hw.c -DXPRJ_ATMega328PB=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Bootloader/main.o: Bootloader/main.c .generated_files/flags/ATMega328PB/fd297987810580d406c3a07777d6304a81d251d7 .generated_files/flags/ATMega328PB/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Bootloader"
@${RM} ${OBJECTDIR}/Bootloader/main.o.d
@${RM} ${OBJECTDIR}/Bootloader/main.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Bootloader/main.o.d" -MT "${OBJECTDIR}/Bootloader/main.o.d" -MT ${OBJECTDIR}/Bootloader/main.o -o ${OBJECTDIR}/Bootloader/main.o Bootloader/main.c -DXPRJ_ATMega328PB=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Components/bootFunctions.o: Components/bootFunctions.c .generated_files/flags/ATMega328PB/e813cb03b32389ecdae61edeccf1263c29055b7 .generated_files/flags/ATMega328PB/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Components"
@${RM} ${OBJECTDIR}/Components/bootFunctions.o.d
@${RM} ${OBJECTDIR}/Components/bootFunctions.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Components/bootFunctions.o.d" -MT "${OBJECTDIR}/Components/bootFunctions.o.d" -MT ${OBJECTDIR}/Components/bootFunctions.o -o ${OBJECTDIR}/Components/bootFunctions.o Components/bootFunctions.c -DXPRJ_ATMega328PB=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusSlave/MEMORY.o: IdiBusSlave/MEMORY.c .generated_files/flags/ATMega328PB/1eb7ce8d8aa42d97d11a9d3d6493a7fab5f6cb99 .generated_files/flags/ATMega328PB/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusSlave"
@${RM} ${OBJECTDIR}/IdiBusSlave/MEMORY.o.d
@${RM} ${OBJECTDIR}/IdiBusSlave/MEMORY.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave/MEMORY.o.d" -MT "${OBJECTDIR}/IdiBusSlave/MEMORY.o.d" -MT ${OBJECTDIR}/IdiBusSlave/MEMORY.o -o ${OBJECTDIR}/IdiBusSlave/MEMORY.o IdiBusSlave/MEMORY.c -DXPRJ_ATMega328PB=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusSlave/RSLink.o: IdiBusSlave/RSLink.c .generated_files/flags/ATMega328PB/2b88d4e3c6a2040a04c021931f3b655a996f574a .generated_files/flags/ATMega328PB/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusSlave"
@${RM} ${OBJECTDIR}/IdiBusSlave/RSLink.o.d
@${RM} ${OBJECTDIR}/IdiBusSlave/RSLink.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave/RSLink.o.d" -MT "${OBJECTDIR}/IdiBusSlave/RSLink.o.d" -MT ${OBJECTDIR}/IdiBusSlave/RSLink.o -o ${OBJECTDIR}/IdiBusSlave/RSLink.o IdiBusSlave/RSLink.c -DXPRJ_ATMega328PB=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusSlave/USART1.o: IdiBusSlave/USART1.c .generated_files/flags/ATMega328PB/a6f479f25cd67e670e0d556b1f8cccd84ce4868e .generated_files/flags/ATMega328PB/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusSlave"
@${RM} ${OBJECTDIR}/IdiBusSlave/USART1.o.d
@${RM} ${OBJECTDIR}/IdiBusSlave/USART1.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave/USART1.o.d" -MT "${OBJECTDIR}/IdiBusSlave/USART1.o.d" -MT ${OBJECTDIR}/IdiBusSlave/USART1.o -o ${OBJECTDIR}/IdiBusSlave/USART1.o IdiBusSlave/USART1.c -DXPRJ_ATMega328PB=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Required/AES.o: Required/AES.c .generated_files/flags/ATMega328PB/83f0c77e00dc1050b229c2a4ae31d44f254879c1 .generated_files/flags/ATMega328PB/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Required"
@${RM} ${OBJECTDIR}/Required/AES.o.d
@${RM} ${OBJECTDIR}/Required/AES.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Required/AES.o.d" -MT "${OBJECTDIR}/Required/AES.o.d" -MT ${OBJECTDIR}/Required/AES.o -o ${OBJECTDIR}/Required/AES.o Required/AES.c -DXPRJ_ATMega328PB=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Required/CRCs.o: Required/CRCs.c .generated_files/flags/ATMega328PB/85250eeaa3e88710d89d7d1b2b986e017bc44c25 .generated_files/flags/ATMega328PB/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Required"
@${RM} ${OBJECTDIR}/Required/CRCs.o.d
@${RM} ${OBJECTDIR}/Required/CRCs.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Required/CRCs.o.d" -MT "${OBJECTDIR}/Required/CRCs.o.d" -MT ${OBJECTDIR}/Required/CRCs.o -o ${OBJECTDIR}/Required/CRCs.o Required/CRCs.c -DXPRJ_ATMega328PB=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/Required/System.o: Required/System.c .generated_files/flags/ATMega328PB/b9cc6460f4dcaf4915acbbd701ad0c27d2b2551 .generated_files/flags/ATMega328PB/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/Required"
@${RM} ${OBJECTDIR}/Required/System.o.d
@${RM} ${OBJECTDIR}/Required/System.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"Bootloader" -I"Components" -I"IdiBusSlave" -I"Required" -funsigned-char -funsigned-bitfields -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/Required/System.o.d" -MT "${OBJECTDIR}/Required/System.o.d" -MT ${OBJECTDIR}/Required/System.o -o ${OBJECTDIR}/Required/System.o Required/System.c -DXPRJ_ATMega328PB=$(CND_CONF) $(COMPARISON_BUILD)
endif
# ------------------------------------------------------------------------------------
# Rules for buildStep: compileCPP
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
else
endif
# ------------------------------------------------------------------------------------
# Rules for buildStep: link
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${DISTDIR}
${MP_CC} $(MP_EXTRA_LD_PRE) -mmcu=atmega328pb ${PACK_COMMON_OPTIONS} -gdwarf-2 -D__$(MP_PROCESSOR_OPTION)__ -Wl,-Map="${DISTDIR}\idibusslavebootloader.${IMAGE_TYPE}.map" -Wl,-section-start=.locationInApp=0x6f80 -Wl,-section-start=.text=0x7000 -Wl,-section-start=.locationInBoot=0x7fd0 -o ${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${OUTPUT_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -DXPRJ_ATMega328PB=$(CND_CONF) $(COMPARISON_BUILD) -Wl,--defsym=__MPLAB_BUILD=1$(MP_EXTRA_LD_POST)$(MP_LINKER_FILE_OPTION),--defsym=__ICD2RAM=1,--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1 -Wl,--gc-sections -Wl,--start-group -Wl,-lm -Wl,--end-group
else
${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${DISTDIR}
${MP_CC} $(MP_EXTRA_LD_PRE) -mmcu=atmega328pb ${PACK_COMMON_OPTIONS} -D__$(MP_PROCESSOR_OPTION)__ -Wl,-Map="${DISTDIR}\idibusslavebootloader.${IMAGE_TYPE}.map" -Wl,-section-start=.locationInApp=0x6f80 -Wl,-section-start=.text=0x7000 -Wl,-section-start=.locationInBoot=0x7fd0 -o ${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -DXPRJ_ATMega328PB=$(CND_CONF) $(COMPARISON_BUILD) -Wl,--defsym=__MPLAB_BUILD=1$(MP_EXTRA_LD_POST)$(MP_LINKER_FILE_OPTION) -Wl,--gc-sections -Wl,--start-group -Wl,-lm -Wl,--end-group
${MP_CC_DIR}\\avr-objcopy -O ihex "${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX}" "${DISTDIR}/idibusslavebootloader.${IMAGE_TYPE}.hex"
endif
# Subprojects
.build-subprojects:
# Subprojects
.clean-subprojects:
# Clean Targets
.clean-conf: ${CLEAN_SUBPROJECTS}
${RM} -r ${OBJECTDIR}
${RM} -r ${DISTDIR}
# Enable dependency checking
.dep.inc: .depcheck-impl
DEPFILES=$(wildcard ${POSSIBLE_DEPFILES})
ifneq (${DEPFILES},)
include ${DEPFILES}
endif

@ -0,0 +1,23 @@
#
#Wed Jun 17 16:04:51 MSK 2026
proj.dir=C\:\\Users\\Michail\\MPLABXProjects\\IdiBus_Logger\\idibusslavebootloader
ATMega328PB.com-microchip-mplab-mdbcore-snap-SnapToolImpl.md5=9c1569a5576813e12972559e1a91a529
com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=6cd85c1014597ae4d039afea70fe46c5
ATMega2560.languagetoolchain.version=14.2.0
ATMega2560.Pack.dfplocation=C\:\\Users\\Michail\\.mchp_packs\\Microchip\\ATmega_DFP\\3.5.296
ATMega1280.languagetoolchain.version=14.2.0
ATMega328PB.languagetoolchain.dir=C\:\\Users\\Michail\\AVR\\cooler_tool\\bin
configurations-xml=c6daa19520ff834ba57b2f33de246247
ATMega328PB.Pack.dfplocation=C\:\\Users\\Michail\\.mchp_packs\\Microchip\\ATmega_DFP\\3.5.296
ATMega328PB.com-microchip-mplab-nbide-toolchain-avr-AVRLanguageToolchain.md5=7077cb0f7d3286937e616ce3e96e957a
ATMega2560.com-microchip-mplab-nbide-toolchain-avr-AVRLanguageToolchain.md5=7077cb0f7d3286937e616ce3e96e957a
host.platform=windows
ATMega328PB.languagetoolchain.version=14.2.0
ATMega2560.languagetoolchain.dir=C\:\\Users\\Michail\\AVR\\cooler_tool\\bin
ATMega1280.Pack.dfplocation=C\:\\Users\\Michail\\.mchp_packs\\Microchip\\ATmega_DFP\\3.5.296
ATMega1280.languagetoolchain.dir=C\:\\Users\\Michail\\AVR\\cooler_tool\\bin
host.id=1au8-yc59-u8
conf.ids=ATMega328PB,ATMega1280,ATMega2560
ATMega1280.com-microchip-mplab-mdbcore-snap-SnapToolImpl.md5=9c1569a5576813e12972559e1a91a529
ATMega2560.com-microchip-mplab-mdbcore-snap-SnapToolImpl.md5=9c1569a5576813e12972559e1a91a529
ATMega1280.com-microchip-mplab-nbide-toolchain-avr-AVRLanguageToolchain.md5=7077cb0f7d3286937e616ce3e96e957a

@ -0,0 +1,73 @@
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a pre- and a post- target defined where you can add customization code.
#
# This makefile implements macros and targets common to all configurations.
#
# NOCDDL
# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
# and .clean-reqprojects-conf unless SUB has the value 'no'
SUB_no=NO
SUBPROJECTS=${SUB_${SUB}}
BUILD_SUBPROJECTS_=.build-subprojects
BUILD_SUBPROJECTS_NO=
BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
CLEAN_SUBPROJECTS_=.clean-subprojects
CLEAN_SUBPROJECTS_NO=
CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
# Project Name
PROJECTNAME=idibusslavebootloader
# Active Configuration
DEFAULTCONF=ATMega1280
CONF=${DEFAULTCONF}
# All Configurations
ALLCONFS=ATMega328PB ATMega1280 ATMega2560
# build
.build-impl: .build-pre
${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf
# clean
.clean-impl: .clean-pre
${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf
# clobber
.clobber-impl: .clobber-pre .depcheck-impl
${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=ATMega328PB clean
${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=ATMega1280 clean
${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=ATMega2560 clean
# all
.all-impl: .all-pre .depcheck-impl
${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=ATMega328PB build
${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=ATMega1280 build
${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=ATMega2560 build
# dependency checking support
.depcheck-impl:
# @echo "# This code depends on make tool being used" >.dep.inc
# @if [ -n "${MAKE_VERSION}" ]; then \
# echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \
# echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
# echo "include \$${DEPFILES}" >>.dep.inc; \
# echo "endif" >>.dep.inc; \
# else \
# echo ".KEEP_STATE:" >>.dep.inc; \
# echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
# fi

@ -0,0 +1,37 @@
#
# Generated Makefile - do not edit!
#
#
# This file contains information about the location of compilers and other tools.
# If you commmit this file into your revision control server, you will be able to
# to checkout the project and build it from the command line with make. However,
# if more than one person works on the same project, then this file might show
# conflicts since different users are bound to have compilers in different places.
# In that case you might choose to not commit this file and let MPLAB X recreate this file
# for each user. The disadvantage of not commiting this file is that you must run MPLAB X at
# least once so the file gets created and the project can be built. Finally, you can also
# avoid using this file at all if you are only building from the command line with make.
# You can invoke make with the values of the macros:
# $ makeMP_CC="/opt/microchip/mplabc30/v3.30c/bin/pic30-gcc" ...
#
SHELL=cmd.exe
PATH_TO_IDE_BIN=C:/Program Files/Microchip/MPLABX/v6.25/mplab_platform/platform/../mplab_ide/modules/../../bin/
# Adding MPLAB X bin directory to path.
PATH:=C:/Program Files/Microchip/MPLABX/v6.25/mplab_platform/platform/../mplab_ide/modules/../../bin/:$(PATH)
# Path to java used to run MPLAB X when this makefile was created
MP_JAVA_PATH="C:\Program Files\Microchip\MPLABX\v6.25\sys\java\zulu8.80.0.17-ca-fx-jre8.0.422-win_x64/bin/"
OS_CURRENT="$(shell uname -s)"
MP_CC="C:\Users\Michail\AVR\cooler_tool\bin\avr-gcc.exe"
MP_CPPC="C:\Users\Michail\AVR\cooler_tool\bin\avr-g++.exe"
# MP_BC is not defined
MP_AS="C:\Users\Michail\AVR\cooler_tool\bin\avr-as.exe"
MP_LD="C:\Users\Michail\AVR\cooler_tool\bin\avr-ld.exe"
MP_AR="C:\Users\Michail\AVR\cooler_tool\bin\avr-gcc-ar.exe"
DEP_GEN=${MP_JAVA_PATH}java -jar "C:/Program Files/Microchip/MPLABX/v6.25/mplab_platform/platform/../mplab_ide/modules/../../bin/extractobjectdependencies.jar"
MP_CC_DIR="C:\Users\Michail\AVR\cooler_tool\bin"
MP_CPPC_DIR="C:\Users\Michail\AVR\cooler_tool\bin"
# MP_BC_DIR is not defined
MP_AS_DIR="C:\Users\Michail\AVR\cooler_tool\bin"
MP_LD_DIR="C:\Users\Michail\AVR\cooler_tool\bin"
MP_AR_DIR="C:\Users\Michail\AVR\cooler_tool\bin"
DFP_DIR=C:/Users/Michail/.mchp_packs/Microchip/ATmega_DFP/3.5.296

@ -0,0 +1,37 @@
#
# Generated Makefile - do not edit!
#
#
# This file contains information about the location of compilers and other tools.
# If you commmit this file into your revision control server, you will be able to
# to checkout the project and build it from the command line with make. However,
# if more than one person works on the same project, then this file might show
# conflicts since different users are bound to have compilers in different places.
# In that case you might choose to not commit this file and let MPLAB X recreate this file
# for each user. The disadvantage of not commiting this file is that you must run MPLAB X at
# least once so the file gets created and the project can be built. Finally, you can also
# avoid using this file at all if you are only building from the command line with make.
# You can invoke make with the values of the macros:
# $ makeMP_CC="/opt/microchip/mplabc30/v3.30c/bin/pic30-gcc" ...
#
SHELL=cmd.exe
PATH_TO_IDE_BIN=C:/Program Files/Microchip/MPLABX/v6.25/mplab_platform/platform/../mplab_ide/modules/../../bin/
# Adding MPLAB X bin directory to path.
PATH:=C:/Program Files/Microchip/MPLABX/v6.25/mplab_platform/platform/../mplab_ide/modules/../../bin/:$(PATH)
# Path to java used to run MPLAB X when this makefile was created
MP_JAVA_PATH="C:\Program Files\Microchip\MPLABX\v6.25\sys\java\zulu8.80.0.17-ca-fx-jre8.0.422-win_x64/bin/"
OS_CURRENT="$(shell uname -s)"
MP_CC="C:\Users\Michail\AVR\cooler_tool\bin\avr-gcc.exe"
MP_CPPC="C:\Users\Michail\AVR\cooler_tool\bin\avr-g++.exe"
# MP_BC is not defined
MP_AS="C:\Users\Michail\AVR\cooler_tool\bin\avr-as.exe"
MP_LD="C:\Users\Michail\AVR\cooler_tool\bin\avr-ld.exe"
MP_AR="C:\Users\Michail\AVR\cooler_tool\bin\avr-gcc-ar.exe"
DEP_GEN=${MP_JAVA_PATH}java -jar "C:/Program Files/Microchip/MPLABX/v6.25/mplab_platform/platform/../mplab_ide/modules/../../bin/extractobjectdependencies.jar"
MP_CC_DIR="C:\Users\Michail\AVR\cooler_tool\bin"
MP_CPPC_DIR="C:\Users\Michail\AVR\cooler_tool\bin"
# MP_BC_DIR is not defined
MP_AS_DIR="C:\Users\Michail\AVR\cooler_tool\bin"
MP_LD_DIR="C:\Users\Michail\AVR\cooler_tool\bin"
MP_AR_DIR="C:\Users\Michail\AVR\cooler_tool\bin"
DFP_DIR=C:/Users/Michail/.mchp_packs/Microchip/ATmega_DFP/3.5.296

@ -0,0 +1,37 @@
#
# Generated Makefile - do not edit!
#
#
# This file contains information about the location of compilers and other tools.
# If you commmit this file into your revision control server, you will be able to
# to checkout the project and build it from the command line with make. However,
# if more than one person works on the same project, then this file might show
# conflicts since different users are bound to have compilers in different places.
# In that case you might choose to not commit this file and let MPLAB X recreate this file
# for each user. The disadvantage of not commiting this file is that you must run MPLAB X at
# least once so the file gets created and the project can be built. Finally, you can also
# avoid using this file at all if you are only building from the command line with make.
# You can invoke make with the values of the macros:
# $ makeMP_CC="/opt/microchip/mplabc30/v3.30c/bin/pic30-gcc" ...
#
SHELL=cmd.exe
PATH_TO_IDE_BIN=C:/Program Files/Microchip/MPLABX/v6.25/mplab_platform/platform/../mplab_ide/modules/../../bin/
# Adding MPLAB X bin directory to path.
PATH:=C:/Program Files/Microchip/MPLABX/v6.25/mplab_platform/platform/../mplab_ide/modules/../../bin/:$(PATH)
# Path to java used to run MPLAB X when this makefile was created
MP_JAVA_PATH="C:\Program Files\Microchip\MPLABX\v6.25\sys\java\zulu8.80.0.17-ca-fx-jre8.0.422-win_x64/bin/"
OS_CURRENT="$(shell uname -s)"
MP_CC="C:\Users\Michail\AVR\cooler_tool\bin\avr-gcc.exe"
MP_CPPC="C:\Users\Michail\AVR\cooler_tool\bin\avr-g++.exe"
# MP_BC is not defined
MP_AS="C:\Users\Michail\AVR\cooler_tool\bin\avr-as.exe"
MP_LD="C:\Users\Michail\AVR\cooler_tool\bin\avr-ld.exe"
MP_AR="C:\Users\Michail\AVR\cooler_tool\bin\avr-gcc-ar.exe"
DEP_GEN=${MP_JAVA_PATH}java -jar "C:/Program Files/Microchip/MPLABX/v6.25/mplab_platform/platform/../mplab_ide/modules/../../bin/extractobjectdependencies.jar"
MP_CC_DIR="C:\Users\Michail\AVR\cooler_tool\bin"
MP_CPPC_DIR="C:\Users\Michail\AVR\cooler_tool\bin"
# MP_BC_DIR is not defined
MP_AS_DIR="C:\Users\Michail\AVR\cooler_tool\bin"
MP_LD_DIR="C:\Users\Michail\AVR\cooler_tool\bin"
MP_AR_DIR="C:\Users\Michail\AVR\cooler_tool\bin"
DFP_DIR=C:/Users/Michail/.mchp_packs/Microchip/ATmega_DFP/3.5.296

@ -0,0 +1,18 @@
#
# Generated - do not edit!
#
# NOCDDL
#
CND_BASEDIR=`pwd`
# ATMega328PB configuration
CND_ARTIFACT_DIR_ATMega328PB=dist/ATMega328PB/production
CND_ARTIFACT_NAME_ATMega328PB=idibusslavebootloader.production.hex
CND_ARTIFACT_PATH_ATMega328PB=dist/ATMega328PB/production/idibusslavebootloader.production.hex
# ATMega1280 configuration
CND_ARTIFACT_DIR_ATMega1280=dist/ATMega1280/production
CND_ARTIFACT_NAME_ATMega1280=idibusslavebootloader.production.hex
CND_ARTIFACT_PATH_ATMega1280=dist/ATMega1280/production/idibusslavebootloader.production.hex
# ATMega2560 configuration
CND_ARTIFACT_DIR_ATMega2560=dist/ATMega2560/production
CND_ARTIFACT_NAME_ATMega2560=idibusslavebootloader.production.hex
CND_ARTIFACT_PATH_ATMega2560=dist/ATMega2560/production/idibusslavebootloader.production.hex

@ -0,0 +1,818 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="65">
<logicalFolder name="root" displayName="root" projectFiles="true">
<logicalFolder name="HeaderFiles"
displayName="Header Files"
projectFiles="true">
<logicalFolder name="Bootloader" displayName="Bootloader" projectFiles="true">
<itemPath>Bootloader/boot.h</itemPath>
<itemPath>Bootloader/config.h</itemPath>
<itemPath>Bootloader/device.h</itemPath>
<itemPath>Bootloader/EEMEM.h</itemPath>
<itemPath>Bootloader/idibus_hw.h</itemPath>
</logicalFolder>
<logicalFolder name="Components" displayName="Components" projectFiles="true">
<itemPath>Components/bootFunctions.h</itemPath>
</logicalFolder>
<logicalFolder name="IdiBusSlave" displayName="IdiBusSlave" projectFiles="true">
<itemPath>IdiBusSlave/IDIBUS_DEFS.h</itemPath>
<itemPath>IdiBusSlave/IDIBUS_IMPL.h</itemPath>
<itemPath>IdiBusSlave/MEMORY.h</itemPath>
<itemPath>IdiBusSlave/RSLink.h</itemPath>
<itemPath>IdiBusSlave/USART1.h</itemPath>
<itemPath>IdiBusSlave/USART_COM.h</itemPath>
</logicalFolder>
<logicalFolder name="Required" displayName="Required" projectFiles="true">
<itemPath>Required/AES.h</itemPath>
<itemPath>Required/CRCs.h</itemPath>
<itemPath>Required/m128_defs.h</itemPath>
<itemPath>Required/m2560_defs.h</itemPath>
<itemPath>Required/m328pb_defs.h</itemPath>
<itemPath>Required/System.h</itemPath>
</logicalFolder>
</logicalFolder>
<logicalFolder name="ExternalFiles"
displayName="Important Files"
projectFiles="true">
<itemPath>Makefile</itemPath>
</logicalFolder>
<logicalFolder name="LinkerScript"
displayName="Linker Files"
projectFiles="true">
</logicalFolder>
<logicalFolder name="SourceFiles"
displayName="Source Files"
projectFiles="true">
<logicalFolder name="Bootloader" displayName="Bootloader" projectFiles="true">
<itemPath>Bootloader/idibus_hw.c</itemPath>
<itemPath>Bootloader/main.c</itemPath>
</logicalFolder>
<logicalFolder name="Components" displayName="Components" projectFiles="true">
<itemPath>Components/bootFunctions.c</itemPath>
</logicalFolder>
<logicalFolder name="IdiBusSlave" displayName="IdiBusSlave" projectFiles="true">
<itemPath>IdiBusSlave/MEMORY.c</itemPath>
<itemPath>IdiBusSlave/RSLink.c</itemPath>
<itemPath>IdiBusSlave/USART1.c</itemPath>
</logicalFolder>
<logicalFolder name="Required" displayName="Required" projectFiles="true">
<itemPath>Required/AES.c</itemPath>
<itemPath>Required/CRCs.c</itemPath>
<itemPath>Required/System.c</itemPath>
</logicalFolder>
</logicalFolder>
</logicalFolder>
<sourceRootList>
<Elem>Bootloader</Elem>
<Elem>Components</Elem>
<Elem>IdiBusSlave</Elem>
<Elem>Required</Elem>
</sourceRootList>
<projectmakefile>Makefile</projectmakefile>
<confs>
<conf name="ATMega328PB" type="2">
<toolsSet>
<developmentServer>localhost</developmentServer>
<targetDevice>ATmega328PB</targetDevice>
<targetHeader></targetHeader>
<targetPluginBoard></targetPluginBoard>
<platformTool>snap</platformTool>
<languageToolchain>AVR</languageToolchain>
<languageToolchainVersion>14.2.0</languageToolchainVersion>
<platform>3</platform>
</toolsSet>
<packs>
<pack name="ATmega_DFP" vendor="Microchip" version="3.5.296"/>
</packs>
<ScriptingSettings>
</ScriptingSettings>
<compileType>
<linkerTool>
<linkerLibItems>
</linkerLibItems>
</linkerTool>
<archiverTool>
</archiverTool>
<loading>
<useAlternateLoadableFile>false</useAlternateLoadableFile>
<parseOnProdLoad>true</parseOnProdLoad>
<alternateLoadableFile></alternateLoadableFile>
</loading>
<subordinates>
</subordinates>
</compileType>
<makeCustomizationType>
<makeCustomizationPreStepEnabled>false</makeCustomizationPreStepEnabled>
<makeUseCleanTarget>false</makeUseCleanTarget>
<makeCustomizationPreStep></makeCustomizationPreStep>
<makeCustomizationPostStepEnabled>false</makeCustomizationPostStepEnabled>
<makeCustomizationPostStep></makeCustomizationPostStep>
<makeCustomizationPutChecksumInUserID>false</makeCustomizationPutChecksumInUserID>
<makeCustomizationEnableLongLines>false</makeCustomizationEnableLongLines>
<makeCustomizationNormalizeHexFile>false</makeCustomizationNormalizeHexFile>
</makeCustomizationType>
<AVR-AR>
<property key="archiver-flags" value="-r"/>
</AVR-AR>
<AVR-AS>
<property key="announce-version" value="false"/>
<property key="include-paths" value=""/>
<property key="suppress-warnings" value="false"/>
</AVR-AS>
<AVR-AS-PRE>
<property key="announce-version" value="false"/>
<property key="include-paths" value=""/>
<property key="preprocessor-macros" value=""/>
<property key="preprocessor-macros-undefined" value=""/>
<property key="suppress-warnings" value="false"/>
</AVR-AS-PRE>
<AVR-CPP>
<property key="additional-warnings" value="true"/>
<property key="call-prologues" value="false"/>
<property key="default-bitfield-type" value="true"/>
<property key="default-char-type" value="true"/>
<property key="extra-include-directories" value=""/>
<property key="garbage-collect-data" value="true"/>
<property key="garbage-collect-functions" value="true"/>
<property key="inhibit-all" value="false"/>
<property key="make-warnings-into-errors" value="false"/>
<property key="no-interrupts" value="false"/>
<property key="no-system-directories" value="false"/>
<property key="optimization-level" value="-O1"/>
<property key="pack-struct" value="true"/>
<property key="preprocess-only" value="false"/>
<property key="preprocessor-macros" value=""/>
<property key="preprocessor-macros-undefined" value=""/>
<property key="save-temps" value="false"/>
<property key="short-calls" value="false"/>
<property key="short-enums" value="true"/>
<property key="strict-ansi" value="false"/>
<property key="strict-ansi-errors" value="false"/>
<property key="support-ansi" value="false"/>
<property key="syntax-only" value="false"/>
<property key="undefined-identifier" value="false"/>
<property key="verbose" value="false"/>
</AVR-CPP>
<AVR-GCC>
<property key="additional-warnings" value="true"/>
<property key="call-prologues" value="false"/>
<property key="default-bitfield-type" value="true"/>
<property key="default-char-type" value="true"/>
<property key="extra-include-directories" value=""/>
<property key="extra-warnings" value="false"/>
<property key="garbage-collect-data" value="true"/>
<property key="garbage-collect-functions" value="true"/>
<property key="inhibit-all" value="false"/>
<property key="make-warnings-into-errors" value="false"/>
<property key="no-interrupts" value="false"/>
<property key="no-system-directories" value="false"/>
<property key="optimization-level" value="-Os"/>
<property key="pack-struct" value="true"/>
<property key="preprocessor-macros" value=""/>
<property key="preprocessor-macros-undefined" value=""/>
<property key="save-temps" value="false"/>
<property key="short-calls" value="false"/>
<property key="short-enums" value="true"/>
<property key="strict-ansi" value="false"/>
<property key="strict-ansi-errors" value="false"/>
<property key="support-ansi" value="false"/>
<property key="syntax-only" value="false"/>
<property key="undefined-identifier" value="false"/>
<property key="verbose" value="false"/>
</AVR-GCC>
<AVR-Global>
<property key="common-include-directories"
value="Bootloader;Components;IdiBusSlave;Required"/>
<property key="eep" value="false"/>
<property key="external-ram-check" value="false"/>
<property key="hex" value="true"/>
<property key="lss" value="false"/>
<property key="omit-pack-options" value="false"/>
<property key="relax-branches" value="false"/>
<property key="srec" value="false"/>
<property key="user-pack-device-support" value=""/>
<property key="user-pack-include" value=""/>
<property key="usersig" value="false"/>
</AVR-Global>
<AVR-LD>
<property key="eeprom-segment" value=""/>
<property key="exclude-standard-libraries" value="false"/>
<property key="extra-lib-directories" value=""/>
<property key="flash-segment"
value=".locationInApp=0x37c0;.text=0x3800;.locationInBoot=0x3fe8"/>
<property key="generate-map-file" value="true"/>
<property key="initial-stack-address" value=""/>
<property key="input-libraries" value="libm"/>
<property key="no-default-libs" value="false"/>
<property key="no-shared-libraries" value="false"/>
<property key="no-startup-files" value="false"/>
<property key="omit-symbol-information" value="false"/>
<property key="other-options" value=""/>
<property key="remove-unused-sections" value="true"/>
<property key="rodata-writable" value="false"/>
<property key="sram-segment" value=""/>
<property key="v-printf" value="false"/>
</AVR-LD>
<Tool>
<property key="AutoSelectMemRanges" value="auto"/>
<property key="ToolFirmwareFilePath"
value="Press to browse for a specific firmware version"/>
<property key="ToolFirmwareOption.UpdateOptions"
value="ToolFirmwareOption.UseLatest"/>
<property key="ToolFirmwareToolPack"
value="Press to select which tool pack to use"/>
<property key="communication.interface" value="isp"/>
<property key="communication.interface.jtag" value="2wire"/>
<property key="communication.speed" value="0,5"/>
<property key="debugoptions.debug-startup" value="Use system settings"/>
<property key="debugoptions.reset-behaviour" value="Use system settings"/>
<property key="debugoptions.simultaneous.debug" value="false"/>
<property key="debugoptions.useswbreakpoints" value="false"/>
<property key="event.recorder.debugger.behavior" value="Running"/>
<property key="event.recorder.enabled" value="false"/>
<property key="event.recorder.scvd.files" value=""/>
<property key="freeze.timers" value="false"/>
<property key="lastid" value=""/>
<property key="memories.aux" value="false"/>
<property key="memories.bootflash" value="true"/>
<property key="memories.configurationmemory" value="true"/>
<property key="memories.configurationmemory2" value="true"/>
<property key="memories.dataflash" value="true"/>
<property key="memories.eeprom" value="true"/>
<property key="memories.exclude.configurationmemory" value="true"/>
<property key="memories.flashdata" value="true"/>
<property key="memories.id" value="true"/>
<property key="memories.instruction.ram.ranges"
value="${memories.instruction.ram.ranges}"/>
<property key="memories.programmemory" value="true"/>
<property key="memories.programmemory.ranges" value="0-3fff"/>
<property key="programmerToGoFilePath"
value="P:/IdiBus/Atmega/IdiBusSlaveBootloader.X/debug/ATMega328PB/IdiBusSlaveBootloader_ptg"/>
<property key="programoptions.donoteraseauxmem" value="false"/>
<property key="programoptions.eraseb4program" value="true"/>
<property key="programoptions.pgmentry.voltage" value="low"/>
<property key="programoptions.pgmspeed" value="Med"/>
<property key="programoptions.preservedataflash" value="false"/>
<property key="programoptions.preservedataflash.ranges" value="0-3ff"/>
<property key="programoptions.preserveeeprom" value="false"/>
<property key="programoptions.preserveeeprom.ranges" value=""/>
<property key="programoptions.preserveprogram.ranges" value=""/>
<property key="programoptions.preserveprogramrange" value="false"/>
<property key="programoptions.programcalmem" value="false"/>
<property key="programoptions.programuserotp" value="false"/>
<property key="programoptions.testmodeentrymethod" value="VDDFirst"/>
<property key="toolpack.updateoptions"
value="toolpack.updateoptions.uselatestoolpack"/>
<property key="toolpack.updateoptions.packversion"
value="Press to select which tool pack to use"/>
</Tool>
<snap>
<property key="AutoSelectMemRanges" value="auto"/>
<property key="ToolFirmwareFilePath"
value="Press to browse for a specific firmware version"/>
<property key="ToolFirmwareOption.UpdateOptions"
value="ToolFirmwareOption.UseLatest"/>
<property key="ToolFirmwareToolPack"
value="Press to select which tool pack to use"/>
<property key="communication.interface" value="isp"/>
<property key="communication.interface.jtag" value="2wire"/>
<property key="communication.speed" value="0,5"/>
<property key="debugoptions.debug-startup" value="Use system settings"/>
<property key="debugoptions.reset-behaviour" value="Use system settings"/>
<property key="debugoptions.simultaneous.debug" value="false"/>
<property key="debugoptions.useswbreakpoints" value="false"/>
<property key="event.recorder.debugger.behavior" value="Running"/>
<property key="event.recorder.enabled" value="false"/>
<property key="event.recorder.scvd.files" value=""/>
<property key="freeze.timers" value="false"/>
<property key="lastid" value=""/>
<property key="memories.aux" value="false"/>
<property key="memories.bootflash" value="true"/>
<property key="memories.configurationmemory" value="true"/>
<property key="memories.configurationmemory2" value="true"/>
<property key="memories.dataflash" value="true"/>
<property key="memories.eeprom" value="true"/>
<property key="memories.exclude.configurationmemory" value="true"/>
<property key="memories.flashdata" value="true"/>
<property key="memories.id" value="true"/>
<property key="memories.instruction.ram.ranges"
value="${memories.instruction.ram.ranges}"/>
<property key="memories.programmemory" value="true"/>
<property key="memories.programmemory.ranges" value="0-3fff"/>
<property key="programoptions.donoteraseauxmem" value="false"/>
<property key="programoptions.eraseb4program" value="true"/>
<property key="programoptions.pgmentry.voltage" value="low"/>
<property key="programoptions.pgmspeed" value="Med"/>
<property key="programoptions.preservedataflash" value="false"/>
<property key="programoptions.preservedataflash.ranges" value="0-3ff"/>
<property key="programoptions.preserveeeprom" value="false"/>
<property key="programoptions.preserveeeprom.ranges" value=""/>
<property key="programoptions.preserveprogram.ranges" value=""/>
<property key="programoptions.preserveprogramrange" value="false"/>
<property key="programoptions.programcalmem" value="false"/>
<property key="programoptions.programuserotp" value="false"/>
<property key="programoptions.testmodeentrymethod" value="VDDFirst"/>
<property key="toolpack.updateoptions"
value="toolpack.updateoptions.uselatestoolpack"/>
<property key="toolpack.updateoptions.packversion"
value="Press to select which tool pack to use"/>
</snap>
</conf>
<conf name="ATMega1280" type="2">
<toolsSet>
<developmentServer>localhost</developmentServer>
<targetDevice>ATmega1280</targetDevice>
<targetHeader></targetHeader>
<targetPluginBoard></targetPluginBoard>
<platformTool>snap</platformTool>
<languageToolchain>AVR</languageToolchain>
<languageToolchainVersion>14.2.0</languageToolchainVersion>
<platform>3</platform>
</toolsSet>
<packs>
<pack name="ATmega_DFP" vendor="Microchip" version="3.5.296"/>
</packs>
<ScriptingSettings>
</ScriptingSettings>
<compileType>
<linkerTool>
<linkerLibItems>
</linkerLibItems>
</linkerTool>
<archiverTool>
</archiverTool>
<loading>
<useAlternateLoadableFile>false</useAlternateLoadableFile>
<parseOnProdLoad>true</parseOnProdLoad>
<alternateLoadableFile></alternateLoadableFile>
</loading>
<subordinates>
</subordinates>
</compileType>
<makeCustomizationType>
<makeCustomizationPreStepEnabled>false</makeCustomizationPreStepEnabled>
<makeUseCleanTarget>false</makeUseCleanTarget>
<makeCustomizationPreStep></makeCustomizationPreStep>
<makeCustomizationPostStepEnabled>false</makeCustomizationPostStepEnabled>
<makeCustomizationPostStep></makeCustomizationPostStep>
<makeCustomizationPutChecksumInUserID>false</makeCustomizationPutChecksumInUserID>
<makeCustomizationEnableLongLines>false</makeCustomizationEnableLongLines>
<makeCustomizationNormalizeHexFile>false</makeCustomizationNormalizeHexFile>
</makeCustomizationType>
<AVR-AR>
<property key="archiver-flags" value="-r"/>
</AVR-AR>
<AVR-AS>
<property key="announce-version" value="false"/>
<property key="include-paths" value=""/>
<property key="suppress-warnings" value="false"/>
</AVR-AS>
<AVR-AS-PRE>
<property key="announce-version" value="false"/>
<property key="include-paths" value=""/>
<property key="preprocessor-macros" value=""/>
<property key="preprocessor-macros-undefined" value=""/>
<property key="suppress-warnings" value="false"/>
</AVR-AS-PRE>
<AVR-CPP>
<property key="additional-warnings" value="true"/>
<property key="call-prologues" value="false"/>
<property key="default-bitfield-type" value="true"/>
<property key="default-char-type" value="true"/>
<property key="extra-include-directories" value=""/>
<property key="garbage-collect-data" value="true"/>
<property key="garbage-collect-functions" value="true"/>
<property key="inhibit-all" value="false"/>
<property key="make-warnings-into-errors" value="false"/>
<property key="no-interrupts" value="false"/>
<property key="no-system-directories" value="false"/>
<property key="optimization-level" value="-O1"/>
<property key="pack-struct" value="true"/>
<property key="preprocess-only" value="false"/>
<property key="preprocessor-macros" value=""/>
<property key="preprocessor-macros-undefined" value=""/>
<property key="save-temps" value="false"/>
<property key="short-calls" value="false"/>
<property key="short-enums" value="true"/>
<property key="strict-ansi" value="false"/>
<property key="strict-ansi-errors" value="false"/>
<property key="support-ansi" value="false"/>
<property key="syntax-only" value="false"/>
<property key="undefined-identifier" value="false"/>
<property key="verbose" value="false"/>
</AVR-CPP>
<AVR-GCC>
<property key="additional-warnings" value="true"/>
<property key="call-prologues" value="false"/>
<property key="default-bitfield-type" value="true"/>
<property key="default-char-type" value="true"/>
<property key="extra-include-directories" value=""/>
<property key="extra-warnings" value="false"/>
<property key="garbage-collect-data" value="true"/>
<property key="garbage-collect-functions" value="true"/>
<property key="inhibit-all" value="false"/>
<property key="make-warnings-into-errors" value="false"/>
<property key="no-interrupts" value="false"/>
<property key="no-system-directories" value="false"/>
<property key="optimization-level" value="-Os"/>
<property key="pack-struct" value="true"/>
<property key="preprocessor-macros" value=""/>
<property key="preprocessor-macros-undefined" value=""/>
<property key="save-temps" value="false"/>
<property key="short-calls" value="false"/>
<property key="short-enums" value="true"/>
<property key="strict-ansi" value="false"/>
<property key="strict-ansi-errors" value="false"/>
<property key="support-ansi" value="false"/>
<property key="syntax-only" value="false"/>
<property key="undefined-identifier" value="false"/>
<property key="verbose" value="false"/>
</AVR-GCC>
<AVR-Global>
<property key="common-include-directories"
value="Bootloader;Components;IdiBusSlave;Required"/>
<property key="eep" value="false"/>
<property key="external-ram-check" value="false"/>
<property key="hex" value="true"/>
<property key="lss" value="false"/>
<property key="omit-pack-options" value="false"/>
<property key="relax-branches" value="false"/>
<property key="srec" value="false"/>
<property key="user-pack-device-support" value=""/>
<property key="user-pack-include" value=""/>
<property key="usersig" value="false"/>
</AVR-Global>
<AVR-LD>
<property key="eeprom-segment" value=""/>
<property key="exclude-standard-libraries" value="false"/>
<property key="extra-lib-directories" value=""/>
<property key="flash-segment"
value=".locationInApp=0xef80;.text=0xf000;.locationInBoot=0xff80"/>
<property key="generate-map-file" value="true"/>
<property key="initial-stack-address" value=""/>
<property key="input-libraries" value="libm"/>
<property key="no-default-libs" value="false"/>
<property key="no-shared-libraries" value="false"/>
<property key="no-startup-files" value="false"/>
<property key="omit-symbol-information" value="false"/>
<property key="other-options" value=""/>
<property key="remove-unused-sections" value="true"/>
<property key="rodata-writable" value="false"/>
<property key="sram-segment" value=""/>
<property key="v-printf" value="false"/>
</AVR-LD>
<Tool>
<property key="AutoSelectMemRanges" value="auto"/>
<property key="ToolFirmwareFilePath"
value="Press to browse for a specific firmware version"/>
<property key="ToolFirmwareOption.UpdateOptions"
value="ToolFirmwareOption.UseLatest"/>
<property key="ToolFirmwareToolPack"
value="Press to select which tool pack to use"/>
<property key="communication.interface" value="isp"/>
<property key="communication.interface.jtag" value="2wire"/>
<property key="communication.speed" value="0,2"/>
<property key="debugoptions.debug-startup" value="Use system settings"/>
<property key="debugoptions.reset-behaviour" value="Use system settings"/>
<property key="debugoptions.simultaneous.debug" value="false"/>
<property key="debugoptions.useswbreakpoints" value="false"/>
<property key="event.recorder.debugger.behavior" value="Running"/>
<property key="event.recorder.enabled" value="false"/>
<property key="event.recorder.scvd.files" value=""/>
<property key="freeze.timers" value="false"/>
<property key="lastid" value=""/>
<property key="memories.aux" value="false"/>
<property key="memories.bootflash" value="true"/>
<property key="memories.configurationmemory" value="true"/>
<property key="memories.configurationmemory2" value="true"/>
<property key="memories.dataflash" value="true"/>
<property key="memories.eeprom" value="true"/>
<property key="memories.exclude.configurationmemory" value="true"/>
<property key="memories.flashdata" value="true"/>
<property key="memories.id" value="true"/>
<property key="memories.instruction.ram.ranges"
value="${memories.instruction.ram.ranges}"/>
<property key="memories.programmemory" value="true"/>
<property key="memories.programmemory.ranges" value="0-ffff"/>
<property key="programmerToGoFilePath"
value="P:/IdiBus/Atmega/IdiBusSlaveBootloader.X/debug/ATMega1280/IdiBusSlaveBootloader_ptg"/>
<property key="programoptions.donoteraseauxmem" value="false"/>
<property key="programoptions.eraseb4program" value="true"/>
<property key="programoptions.pgmentry.voltage" value="low"/>
<property key="programoptions.pgmspeed" value="Med"/>
<property key="programoptions.preservedataflash" value="false"/>
<property key="programoptions.preservedataflash.ranges" value="0-fff"/>
<property key="programoptions.preserveeeprom" value="false"/>
<property key="programoptions.preserveeeprom.ranges" value=""/>
<property key="programoptions.preserveprogram.ranges" value=""/>
<property key="programoptions.preserveprogramrange" value="false"/>
<property key="programoptions.programcalmem" value="false"/>
<property key="programoptions.programuserotp" value="false"/>
<property key="programoptions.testmodeentrymethod" value="VDDFirst"/>
<property key="toolpack.updateoptions"
value="toolpack.updateoptions.uselatestoolpack"/>
<property key="toolpack.updateoptions.packversion"
value="Press to select which tool pack to use"/>
</Tool>
<snap>
<property key="AutoSelectMemRanges" value="auto"/>
<property key="ToolFirmwareFilePath"
value="Press to browse for a specific firmware version"/>
<property key="ToolFirmwareOption.UpdateOptions"
value="ToolFirmwareOption.UseLatest"/>
<property key="ToolFirmwareToolPack"
value="Press to select which tool pack to use"/>
<property key="communication.interface" value="isp"/>
<property key="communication.interface.jtag" value="2wire"/>
<property key="communication.speed" value="0,2"/>
<property key="debugoptions.debug-startup" value="Use system settings"/>
<property key="debugoptions.reset-behaviour" value="Use system settings"/>
<property key="debugoptions.simultaneous.debug" value="false"/>
<property key="debugoptions.useswbreakpoints" value="false"/>
<property key="event.recorder.debugger.behavior" value="Running"/>
<property key="event.recorder.enabled" value="false"/>
<property key="event.recorder.scvd.files" value=""/>
<property key="freeze.timers" value="false"/>
<property key="lastid" value=""/>
<property key="memories.aux" value="false"/>
<property key="memories.bootflash" value="true"/>
<property key="memories.configurationmemory" value="true"/>
<property key="memories.configurationmemory2" value="true"/>
<property key="memories.dataflash" value="true"/>
<property key="memories.eeprom" value="true"/>
<property key="memories.exclude.configurationmemory" value="true"/>
<property key="memories.flashdata" value="true"/>
<property key="memories.id" value="true"/>
<property key="memories.instruction.ram.ranges"
value="${memories.instruction.ram.ranges}"/>
<property key="memories.programmemory" value="true"/>
<property key="memories.programmemory.ranges" value="0-ffff"/>
<property key="programoptions.donoteraseauxmem" value="false"/>
<property key="programoptions.eraseb4program" value="true"/>
<property key="programoptions.pgmentry.voltage" value="low"/>
<property key="programoptions.pgmspeed" value="Med"/>
<property key="programoptions.preservedataflash" value="false"/>
<property key="programoptions.preservedataflash.ranges" value="0-fff"/>
<property key="programoptions.preserveeeprom" value="false"/>
<property key="programoptions.preserveeeprom.ranges" value=""/>
<property key="programoptions.preserveprogram.ranges" value=""/>
<property key="programoptions.preserveprogramrange" value="false"/>
<property key="programoptions.programcalmem" value="false"/>
<property key="programoptions.programuserotp" value="false"/>
<property key="programoptions.testmodeentrymethod" value="VDDFirst"/>
<property key="toolpack.updateoptions"
value="toolpack.updateoptions.uselatestoolpack"/>
<property key="toolpack.updateoptions.packversion"
value="Press to select which tool pack to use"/>
</snap>
</conf>
<conf name="ATMega2560" type="2">
<toolsSet>
<developmentServer>localhost</developmentServer>
<targetDevice>ATmega2560</targetDevice>
<targetHeader></targetHeader>
<targetPluginBoard></targetPluginBoard>
<platformTool>snap</platformTool>
<languageToolchain>AVR</languageToolchain>
<languageToolchainVersion>14.2.0</languageToolchainVersion>
<platform>3</platform>
</toolsSet>
<packs>
<pack name="ATmega_DFP" vendor="Microchip" version="3.5.296"/>
</packs>
<ScriptingSettings>
</ScriptingSettings>
<compileType>
<linkerTool>
<linkerLibItems>
</linkerLibItems>
</linkerTool>
<archiverTool>
</archiverTool>
<loading>
<useAlternateLoadableFile>false</useAlternateLoadableFile>
<parseOnProdLoad>true</parseOnProdLoad>
<alternateLoadableFile></alternateLoadableFile>
</loading>
<subordinates>
</subordinates>
</compileType>
<makeCustomizationType>
<makeCustomizationPreStepEnabled>false</makeCustomizationPreStepEnabled>
<makeUseCleanTarget>false</makeUseCleanTarget>
<makeCustomizationPreStep></makeCustomizationPreStep>
<makeCustomizationPostStepEnabled>false</makeCustomizationPostStepEnabled>
<makeCustomizationPostStep></makeCustomizationPostStep>
<makeCustomizationPutChecksumInUserID>false</makeCustomizationPutChecksumInUserID>
<makeCustomizationEnableLongLines>false</makeCustomizationEnableLongLines>
<makeCustomizationNormalizeHexFile>false</makeCustomizationNormalizeHexFile>
</makeCustomizationType>
<AVR-AR>
<property key="archiver-flags" value="-r"/>
</AVR-AR>
<AVR-AS>
<property key="announce-version" value="false"/>
<property key="include-paths" value=""/>
<property key="suppress-warnings" value="false"/>
</AVR-AS>
<AVR-AS-PRE>
<property key="announce-version" value="false"/>
<property key="include-paths" value=""/>
<property key="preprocessor-macros" value=""/>
<property key="preprocessor-macros-undefined" value=""/>
<property key="suppress-warnings" value="false"/>
</AVR-AS-PRE>
<AVR-CPP>
<property key="additional-warnings" value="true"/>
<property key="call-prologues" value="false"/>
<property key="default-bitfield-type" value="true"/>
<property key="default-char-type" value="true"/>
<property key="extra-include-directories" value=""/>
<property key="garbage-collect-data" value="true"/>
<property key="garbage-collect-functions" value="true"/>
<property key="inhibit-all" value="false"/>
<property key="make-warnings-into-errors" value="false"/>
<property key="no-interrupts" value="false"/>
<property key="no-system-directories" value="false"/>
<property key="optimization-level" value="-O1"/>
<property key="pack-struct" value="true"/>
<property key="preprocess-only" value="false"/>
<property key="preprocessor-macros" value=""/>
<property key="preprocessor-macros-undefined" value=""/>
<property key="save-temps" value="false"/>
<property key="short-calls" value="false"/>
<property key="short-enums" value="true"/>
<property key="strict-ansi" value="false"/>
<property key="strict-ansi-errors" value="false"/>
<property key="support-ansi" value="false"/>
<property key="syntax-only" value="false"/>
<property key="undefined-identifier" value="false"/>
<property key="verbose" value="false"/>
</AVR-CPP>
<AVR-GCC>
<property key="additional-warnings" value="true"/>
<property key="call-prologues" value="false"/>
<property key="default-bitfield-type" value="true"/>
<property key="default-char-type" value="true"/>
<property key="extra-include-directories" value=""/>
<property key="extra-warnings" value="false"/>
<property key="garbage-collect-data" value="true"/>
<property key="garbage-collect-functions" value="true"/>
<property key="inhibit-all" value="false"/>
<property key="make-warnings-into-errors" value="false"/>
<property key="no-interrupts" value="false"/>
<property key="no-system-directories" value="false"/>
<property key="optimization-level" value="-O1"/>
<property key="pack-struct" value="true"/>
<property key="preprocessor-macros" value=""/>
<property key="preprocessor-macros-undefined" value=""/>
<property key="save-temps" value="false"/>
<property key="short-calls" value="false"/>
<property key="short-enums" value="true"/>
<property key="strict-ansi" value="false"/>
<property key="strict-ansi-errors" value="false"/>
<property key="support-ansi" value="false"/>
<property key="syntax-only" value="false"/>
<property key="undefined-identifier" value="false"/>
<property key="verbose" value="false"/>
</AVR-GCC>
<AVR-Global>
<property key="common-include-directories"
value="Bootloader;Components;IdiBusSlave;Required"/>
<property key="eep" value="false"/>
<property key="external-ram-check" value="false"/>
<property key="hex" value="true"/>
<property key="lss" value="false"/>
<property key="omit-pack-options" value="false"/>
<property key="relax-branches" value="false"/>
<property key="srec" value="false"/>
<property key="user-pack-device-support" value=""/>
<property key="user-pack-include" value=""/>
<property key="usersig" value="false"/>
</AVR-Global>
<AVR-LD>
<property key="eeprom-segment" value=""/>
<property key="exclude-standard-libraries" value="false"/>
<property key="extra-lib-directories" value=""/>
<property key="flash-segment"
value=".locationInApp=0x1ef80;.text=0x1f000;.locationInBoot=0x1ff80"/>
<property key="generate-map-file" value="true"/>
<property key="initial-stack-address" value=""/>
<property key="input-libraries" value="libm"/>
<property key="no-default-libs" value="false"/>
<property key="no-shared-libraries" value="false"/>
<property key="no-startup-files" value="false"/>
<property key="omit-symbol-information" value="false"/>
<property key="other-options" value=""/>
<property key="remove-unused-sections" value="true"/>
<property key="rodata-writable" value="false"/>
<property key="sram-segment" value=""/>
<property key="v-printf" value="false"/>
</AVR-LD>
<Tool>
<property key="AutoSelectMemRanges" value="auto"/>
<property key="ToolFirmwareFilePath"
value="Press to browse for a specific firmware version"/>
<property key="ToolFirmwareOption.UpdateOptions"
value="ToolFirmwareOption.UseLatest"/>
<property key="ToolFirmwareToolPack"
value="Press to select which tool pack to use"/>
<property key="communication.interface" value="isp"/>
<property key="communication.interface.jtag" value="2wire"/>
<property key="communication.speed" value="0,3"/>
<property key="debugoptions.debug-startup" value="Use system settings"/>
<property key="debugoptions.reset-behaviour" value="Use system settings"/>
<property key="debugoptions.simultaneous.debug" value="false"/>
<property key="debugoptions.useswbreakpoints" value="false"/>
<property key="event.recorder.debugger.behavior" value="Running"/>
<property key="event.recorder.enabled" value="false"/>
<property key="event.recorder.scvd.files" value=""/>
<property key="freeze.timers" value="false"/>
<property key="lastid" value=""/>
<property key="memories.aux" value="false"/>
<property key="memories.bootflash" value="true"/>
<property key="memories.configurationmemory" value="true"/>
<property key="memories.configurationmemory2" value="true"/>
<property key="memories.dataflash" value="true"/>
<property key="memories.eeprom" value="true"/>
<property key="memories.exclude.configurationmemory" value="true"/>
<property key="memories.flashdata" value="true"/>
<property key="memories.id" value="true"/>
<property key="memories.instruction.ram.ranges"
value="${memories.instruction.ram.ranges}"/>
<property key="memories.programmemory" value="true"/>
<property key="memories.programmemory.ranges" value="0-1ffff"/>
<property key="programmerToGoFilePath"
value="P:/IdiBus/Atmega/IdiBusSlaveBootloader.X/debug/ATMega2560/IdiBusSlaveBootloader_ptg"/>
<property key="programoptions.donoteraseauxmem" value="false"/>
<property key="programoptions.eraseb4program" value="true"/>
<property key="programoptions.pgmentry.voltage" value="low"/>
<property key="programoptions.pgmspeed" value="Med"/>
<property key="programoptions.preservedataflash" value="false"/>
<property key="programoptions.preservedataflash.ranges" value="0-fff"/>
<property key="programoptions.preserveeeprom" value="false"/>
<property key="programoptions.preserveeeprom.ranges" value=""/>
<property key="programoptions.preserveprogram.ranges" value=""/>
<property key="programoptions.preserveprogramrange" value="false"/>
<property key="programoptions.programcalmem" value="false"/>
<property key="programoptions.programuserotp" value="false"/>
<property key="programoptions.testmodeentrymethod" value="VDDFirst"/>
<property key="toolpack.updateoptions"
value="toolpack.updateoptions.uselatestoolpack"/>
<property key="toolpack.updateoptions.packversion"
value="Press to select which tool pack to use"/>
</Tool>
<snap>
<property key="AutoSelectMemRanges" value="auto"/>
<property key="ToolFirmwareFilePath"
value="Press to browse for a specific firmware version"/>
<property key="ToolFirmwareOption.UpdateOptions"
value="ToolFirmwareOption.UseLatest"/>
<property key="ToolFirmwareToolPack"
value="Press to select which tool pack to use"/>
<property key="communication.interface" value="isp"/>
<property key="communication.interface.jtag" value="2wire"/>
<property key="communication.speed" value="0,3"/>
<property key="debugoptions.debug-startup" value="Use system settings"/>
<property key="debugoptions.reset-behaviour" value="Use system settings"/>
<property key="debugoptions.simultaneous.debug" value="false"/>
<property key="debugoptions.useswbreakpoints" value="false"/>
<property key="event.recorder.debugger.behavior" value="Running"/>
<property key="event.recorder.enabled" value="false"/>
<property key="event.recorder.scvd.files" value=""/>
<property key="freeze.timers" value="false"/>
<property key="lastid" value=""/>
<property key="memories.aux" value="false"/>
<property key="memories.bootflash" value="true"/>
<property key="memories.configurationmemory" value="true"/>
<property key="memories.configurationmemory2" value="true"/>
<property key="memories.dataflash" value="true"/>
<property key="memories.eeprom" value="true"/>
<property key="memories.exclude.configurationmemory" value="true"/>
<property key="memories.flashdata" value="true"/>
<property key="memories.id" value="true"/>
<property key="memories.instruction.ram.ranges"
value="${memories.instruction.ram.ranges}"/>
<property key="memories.programmemory" value="true"/>
<property key="memories.programmemory.ranges" value="0-1ffff"/>
<property key="programoptions.donoteraseauxmem" value="false"/>
<property key="programoptions.eraseb4program" value="true"/>
<property key="programoptions.pgmentry.voltage" value="low"/>
<property key="programoptions.pgmspeed" value="Med"/>
<property key="programoptions.preservedataflash" value="false"/>
<property key="programoptions.preservedataflash.ranges" value="0-fff"/>
<property key="programoptions.preserveeeprom" value="false"/>
<property key="programoptions.preserveeeprom.ranges" value=""/>
<property key="programoptions.preserveprogram.ranges" value=""/>
<property key="programoptions.preserveprogramrange" value="false"/>
<property key="programoptions.programcalmem" value="false"/>
<property key="programoptions.programuserotp" value="false"/>
<property key="programoptions.testmodeentrymethod" value="VDDFirst"/>
<property key="toolpack.updateoptions"
value="toolpack.updateoptions.uselatestoolpack"/>
<property key="toolpack.updateoptions.packversion"
value="Press to select which tool pack to use"/>
</snap>
</conf>
</confs>
</configurationDescriptor>

@ -0,0 +1,3 @@
#
#Tue Jun 16 16:28:34 MSK 2026
realice/DEVID_MISMATCH=true

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="65">
<projectmakefile>Makefile</projectmakefile>
<defaultConf>1</defaultConf>
<confs>
<conf name="ATMega328PB" type="2">
<platformToolSN>:=MPLABComm-USB-Microchip:=&lt;vid>04D8:=&lt;pid>9018:=&lt;rev>0100:=&lt;man>Microchip Technology Incorporated:=&lt;prod>MPLAB Snap ICD:=&lt;sn>021038102RYN007988:=&lt;drv>x:=&lt;xpt>b:=end</platformToolSN>
<languageToolchainDir>C:\Users\Michail\AVR\cooler_tool\bin</languageToolchainDir>
<mdbdebugger version="1">
<placeholder1>place holder 1</placeholder1>
<placeholder2>place holder 2</placeholder2>
</mdbdebugger>
<runprofile version="6">
<args></args>
<rundir></rundir>
<buildfirst>true</buildfirst>
<console-type>0</console-type>
<terminal-type>0</terminal-type>
<remove-instrumentation>0</remove-instrumentation>
<environment>
</environment>
</runprofile>
</conf>
<conf name="ATMega1280" type="2">
<platformToolSN>:=MPLABComm-USB-Microchip:=&lt;vid>04D8:=&lt;pid>9018:=&lt;rev>0100:=&lt;man>Microchip Technology Incorporated:=&lt;prod>MPLAB Snap ICD:=&lt;sn>021038102RYN007986:=&lt;drv>x:=&lt;xpt>b:=end</platformToolSN>
<languageToolchainDir>C:\Users\Michail\AVR\cooler_tool\bin</languageToolchainDir>
<mdbdebugger version="1">
<placeholder1>place holder 1</placeholder1>
<placeholder2>place holder 2</placeholder2>
</mdbdebugger>
<runprofile version="6">
<args></args>
<rundir></rundir>
<buildfirst>true</buildfirst>
<console-type>0</console-type>
<terminal-type>0</terminal-type>
<remove-instrumentation>0</remove-instrumentation>
<environment>
</environment>
</runprofile>
</conf>
<conf name="ATMega2560" type="2">
<platformToolSN>:=MPLABComm-USB-Microchip:=&lt;vid>04D8:=&lt;pid>9018:=&lt;rev>0100:=&lt;man>Microchip Technology Incorporated:=&lt;prod>MPLAB Snap ICD:=&lt;sn>021038102RYN007988:=&lt;drv>x:=&lt;xpt>b:=end</platformToolSN>
<languageToolchainDir>C:\Users\Michail\AVR\cooler_tool\bin</languageToolchainDir>
<mdbdebugger version="1">
<placeholder1>place holder 1</placeholder1>
<placeholder2>place holder 2</placeholder2>
</mdbdebugger>
<runprofile version="6">
<args></args>
<rundir></rundir>
<buildfirst>true</buildfirst>
<console-type>0</console-type>
<terminal-type>0</terminal-type>
<remove-instrumentation>0</remove-instrumentation>
<environment>
</environment>
</runprofile>
</conf>
</confs>
</configurationDescriptor>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group/>
</open-files>
</project-private>

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/make-project/1">
<name>IdiBusSlaveBootloader</name>
<creation-uuid>41948584-7115-43c3-8915-5af0e376f250</creation-uuid>
<make-project-type>0</make-project-type>
<sourceEncoding>windows-1251</sourceEncoding>
<make-dep-projects/>
<sourceRootList>
<sourceRootElem>Bootloader</sourceRootElem>
<sourceRootElem>Components</sourceRootElem>
<sourceRootElem>IdiBusSlave</sourceRootElem>
<sourceRootElem>Required</sourceRootElem>
</sourceRootList>
<confList>
<confElem>
<name>ATMega328PB</name>
<type>2</type>
</confElem>
<confElem>
<name>ATMega1280</name>
<type>2</type>
</confElem>
<confElem>
<name>ATMega2560</name>
<type>2</type>
</confElem>
</confList>
<formatting>
<project-formatting-style>false</project-formatting-style>
</formatting>
</data>
</configuration>
</project>

@ -30,12 +30,12 @@ ifeq ($(TYPE_IMAGE), DEBUG_RUN)
IMAGE_TYPE=debug IMAGE_TYPE=debug
OUTPUT_SUFFIX=elf OUTPUT_SUFFIX=elf
DEBUGGABLE_SUFFIX=elf DEBUGGABLE_SUFFIX=elf
FINAL_IMAGE=${DISTDIR}/IdiBusSlaveTemplate.${IMAGE_TYPE}.${OUTPUT_SUFFIX} FINAL_IMAGE=${DISTDIR}/IdiBus_Logger.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
else else
IMAGE_TYPE=production IMAGE_TYPE=production
OUTPUT_SUFFIX=hex OUTPUT_SUFFIX=hex
DEBUGGABLE_SUFFIX=elf DEBUGGABLE_SUFFIX=elf
FINAL_IMAGE=${DISTDIR}/IdiBusSlaveTemplate.${IMAGE_TYPE}.${OUTPUT_SUFFIX} FINAL_IMAGE=${DISTDIR}/IdiBus_Logger.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
endif endif
ifeq ($(COMPARE_BUILD), true) ifeq ($(COMPARE_BUILD), true)
@ -51,21 +51,21 @@ OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE}
DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE} DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE}
# Source Files Quoted if spaced # Source Files Quoted if spaced
SOURCEFILES_QUOTED_IF_SPACED=IdiBusCore/IdiBus/IDIBUS_IMPL.c IdiBusCore/IdiBus/RSLink.c IdiBusCore/Required/MEMORY.c IdiBusCore/Required/MODBUS_CRC.c IdiBusCore/Required/SYSTEM.c IdiBusCore/Required/USART1.c IdiBusCore/idibus_custom.c IdiBusCore/idibus_hw.c IdiBusCore/main.c IdiBusSlave.cpp SOURCEFILES_QUOTED_IF_SPACED=components/DS3231/DS3231.c components/DS3231/i2cMaster.c components/Serial.cpp IdiBusCore/IdiBus/IDIBUS_IMPL.c IdiBusCore/IdiBus/RSLink.c IdiBusCore/Required/MEMORY.c IdiBusCore/Required/MODBUS_CRC.c IdiBusCore/Required/SYSTEM.c IdiBusCore/Required/USART1.c IdiBusCore/idibus_custom.c IdiBusCore/idibus_hw.c IdiBusCore/main.c IdiBusSlave.cpp
# Object Files Quoted if spaced # Object Files Quoted if spaced
OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o ${OBJECTDIR}/IdiBusCore/Required/USART1.o ${OBJECTDIR}/IdiBusCore/idibus_custom.o ${OBJECTDIR}/IdiBusCore/idibus_hw.o ${OBJECTDIR}/IdiBusCore/main.o ${OBJECTDIR}/IdiBusSlave.o OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/components/DS3231/DS3231.o ${OBJECTDIR}/components/DS3231/i2cMaster.o ${OBJECTDIR}/components/Serial.o ${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o ${OBJECTDIR}/IdiBusCore/Required/USART1.o ${OBJECTDIR}/IdiBusCore/idibus_custom.o ${OBJECTDIR}/IdiBusCore/idibus_hw.o ${OBJECTDIR}/IdiBusCore/main.o ${OBJECTDIR}/IdiBusSlave.o
POSSIBLE_DEPFILES=${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o.d ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o.d ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o.d ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o.d ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o.d ${OBJECTDIR}/IdiBusCore/Required/USART1.o.d ${OBJECTDIR}/IdiBusCore/idibus_custom.o.d ${OBJECTDIR}/IdiBusCore/idibus_hw.o.d ${OBJECTDIR}/IdiBusCore/main.o.d ${OBJECTDIR}/IdiBusSlave.o.d POSSIBLE_DEPFILES=${OBJECTDIR}/components/DS3231/DS3231.o.d ${OBJECTDIR}/components/DS3231/i2cMaster.o.d ${OBJECTDIR}/components/Serial.o.d ${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o.d ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o.d ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o.d ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o.d ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o.d ${OBJECTDIR}/IdiBusCore/Required/USART1.o.d ${OBJECTDIR}/IdiBusCore/idibus_custom.o.d ${OBJECTDIR}/IdiBusCore/idibus_hw.o.d ${OBJECTDIR}/IdiBusCore/main.o.d ${OBJECTDIR}/IdiBusSlave.o.d
# Object Files # Object Files
OBJECTFILES=${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o ${OBJECTDIR}/IdiBusCore/Required/USART1.o ${OBJECTDIR}/IdiBusCore/idibus_custom.o ${OBJECTDIR}/IdiBusCore/idibus_hw.o ${OBJECTDIR}/IdiBusCore/main.o ${OBJECTDIR}/IdiBusSlave.o OBJECTFILES=${OBJECTDIR}/components/DS3231/DS3231.o ${OBJECTDIR}/components/DS3231/i2cMaster.o ${OBJECTDIR}/components/Serial.o ${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o ${OBJECTDIR}/IdiBusCore/Required/USART1.o ${OBJECTDIR}/IdiBusCore/idibus_custom.o ${OBJECTDIR}/IdiBusCore/idibus_hw.o ${OBJECTDIR}/IdiBusCore/main.o ${OBJECTDIR}/IdiBusSlave.o
# Source Files # Source Files
SOURCEFILES=IdiBusCore/IdiBus/IDIBUS_IMPL.c IdiBusCore/IdiBus/RSLink.c IdiBusCore/Required/MEMORY.c IdiBusCore/Required/MODBUS_CRC.c IdiBusCore/Required/SYSTEM.c IdiBusCore/Required/USART1.c IdiBusCore/idibus_custom.c IdiBusCore/idibus_hw.c IdiBusCore/main.c IdiBusSlave.cpp SOURCEFILES=components/DS3231/DS3231.c components/DS3231/i2cMaster.c components/Serial.cpp IdiBusCore/IdiBus/IDIBUS_IMPL.c IdiBusCore/IdiBus/RSLink.c IdiBusCore/Required/MEMORY.c IdiBusCore/Required/MODBUS_CRC.c IdiBusCore/Required/SYSTEM.c IdiBusCore/Required/USART1.c IdiBusCore/idibus_custom.c IdiBusCore/idibus_hw.c IdiBusCore/main.c IdiBusSlave.cpp
# Pack Options # Pack Options
PACK_COMPILER_OPTIONS=-I "${DFP_DIR}/include" PACK_COMPILER_OPTIONS=-I "${DFP_DIR}/include"
PACK_COMMON_OPTIONS=-B "${DFP_DIR}/gcc/dev/atmega328pb" PACK_COMMON_OPTIONS=-B "${DFP_DIR}/gcc/dev/atmega1280"
@ -85,13 +85,13 @@ FIXDEPS=fixDeps
# The following macros may be used in the pre and post step lines # The following macros may be used in the pre and post step lines
_/_=\\ _/_=\\
ShExtension=.bat ShExtension=.bat
Device=ATmega328PB Device=ATmega1280
ProjectDir="P:\IdiBus\Atmega\IdiBusSlaveTemplate" ProjectDir="C:\Users\Michail\MPLABXProjects\IdiBus_Logger"
ProjectName=IdiBusSlaveTemplate ProjectName=IdiBus_Logger
ConfName=default ConfName=default
ImagePath="dist\default\${IMAGE_TYPE}\IdiBusSlaveTemplate.${IMAGE_TYPE}.${OUTPUT_SUFFIX}" ImagePath="dist\default\${IMAGE_TYPE}\IdiBus_Logger.${IMAGE_TYPE}.${OUTPUT_SUFFIX}"
ImageDir="dist\default\${IMAGE_TYPE}" ImageDir="dist\default\${IMAGE_TYPE}"
ImageName="IdiBusSlaveTemplate.${IMAGE_TYPE}.${OUTPUT_SUFFIX}" ImageName="IdiBus_Logger.${IMAGE_TYPE}.${OUTPUT_SUFFIX}"
ifeq ($(TYPE_IMAGE), DEBUG_RUN) ifeq ($(TYPE_IMAGE), DEBUG_RUN)
IsDebug="true" IsDebug="true"
else else
@ -104,13 +104,13 @@ PYFWImageBuilderPath="C:\Users\Michail\AppData\Roaming\mplab_ide\dev\v6.25\bin\w
ifneq ($(INFORMATION_MESSAGE), ) ifneq ($(INFORMATION_MESSAGE), )
@echo $(INFORMATION_MESSAGE) @echo $(INFORMATION_MESSAGE)
endif endif
${MAKE} -f nbproject/Makefile-default.mk ${DISTDIR}/IdiBusSlaveTemplate.${IMAGE_TYPE}.${OUTPUT_SUFFIX} ${MAKE} -f nbproject/Makefile-default.mk ${DISTDIR}/IdiBus_Logger.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
@echo "--------------------------------------" @echo "--------------------------------------"
@echo "User defined post-build step: [IdiBusFPT.exe --cli -o="${ProjectDir}" -n="${ProjectName}" -k="${ProjectDir}\keys.c" -d="${ProjectDir}\device.h" -m="${Device}" -x="${ProjectDir}\dist\default\production\${ProjectName}.production.hex"]" @echo "User defined post-build step: [IdiBusFPT.exe --cli -o="${ProjectDir}" -n="${ProjectName}" -k="${ProjectDir}\keys.c" -d="${ProjectDir}\device.h" -m="${Device}" -x="${ProjectDir}\dist\default\production\${ProjectName}.production.hex"]"
@IdiBusFPT.exe --cli -o="${ProjectDir}" -n="${ProjectName}" -k="${ProjectDir}\keys.c" -d="${ProjectDir}\device.h" -m="${Device}" -x="${ProjectDir}\dist\default\production\${ProjectName}.production.hex" @IdiBusFPT.exe --cli -o="${ProjectDir}" -n="${ProjectName}" -k="${ProjectDir}\keys.c" -d="${ProjectDir}\device.h" -m="${Device}" -x="${ProjectDir}\dist\default\production\${ProjectName}.production.hex"
@echo "--------------------------------------" @echo "--------------------------------------"
MP_PROCESSOR_OPTION=ATmega328PB MP_PROCESSOR_OPTION=ATmega1280
# ------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------
# Rules for buildStep: assemble # Rules for buildStep: assemble
ifeq ($(TYPE_IMAGE), DEBUG_RUN) ifeq ($(TYPE_IMAGE), DEBUG_RUN)
@ -126,141 +126,177 @@ endif
# ------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------
# Rules for buildStep: compile # Rules for buildStep: compile
ifeq ($(TYPE_IMAGE), DEBUG_RUN) ifeq ($(TYPE_IMAGE), DEBUG_RUN)
${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o: IdiBusCore/IdiBus/IDIBUS_IMPL.c .generated_files/flags/default/e9a38142752595870859f111653c5e1ce9c519 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/components/DS3231/DS3231.o: components/DS3231/DS3231.c .generated_files/flags/default/50350ab519a922d0263486f669cf2669f2c8512c .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/components/DS3231"
@${RM} ${OBJECTDIR}/components/DS3231/DS3231.o.d
@${RM} ${OBJECTDIR}/components/DS3231/DS3231.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/components/DS3231/DS3231.o.d" -MT "${OBJECTDIR}/components/DS3231/DS3231.o.d" -MT ${OBJECTDIR}/components/DS3231/DS3231.o -o ${OBJECTDIR}/components/DS3231/DS3231.o components/DS3231/DS3231.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/components/DS3231/i2cMaster.o: components/DS3231/i2cMaster.c .generated_files/flags/default/5f0f8ce9bd702055c7459161074d9f521bbac4f5 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/components/DS3231"
@${RM} ${OBJECTDIR}/components/DS3231/i2cMaster.o.d
@${RM} ${OBJECTDIR}/components/DS3231/i2cMaster.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/components/DS3231/i2cMaster.o.d" -MT "${OBJECTDIR}/components/DS3231/i2cMaster.o.d" -MT ${OBJECTDIR}/components/DS3231/i2cMaster.o -o ${OBJECTDIR}/components/DS3231/i2cMaster.o components/DS3231/i2cMaster.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o: IdiBusCore/IdiBus/IDIBUS_IMPL.c .generated_files/flags/default/d4d431dd98aa10b3ebf5ed5198710bcf91594af1 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusCore/IdiBus" @${MKDIR} "${OBJECTDIR}/IdiBusCore/IdiBus"
@${RM} ${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o.d @${RM} ${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o.d
@${RM} ${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o @${RM} ${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o.d" -MT "${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o.d" -MT ${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o -o ${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o IdiBusCore/IdiBus/IDIBUS_IMPL.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) ${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o.d" -MT "${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o.d" -MT ${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o -o ${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o IdiBusCore/IdiBus/IDIBUS_IMPL.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o: IdiBusCore/IdiBus/RSLink.c .generated_files/flags/default/66c7d382ea20b9b3a9f082eb9b239ccaface02f6 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o: IdiBusCore/IdiBus/RSLink.c .generated_files/flags/default/9839f1789d4cecd384998fc265b74172eabf8e9f .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusCore/IdiBus" @${MKDIR} "${OBJECTDIR}/IdiBusCore/IdiBus"
@${RM} ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o.d @${RM} ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o.d
@${RM} ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o @${RM} ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o.d" -MT "${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o.d" -MT ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o -o ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o IdiBusCore/IdiBus/RSLink.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) ${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o.d" -MT "${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o.d" -MT ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o -o ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o IdiBusCore/IdiBus/RSLink.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusCore/Required/MEMORY.o: IdiBusCore/Required/MEMORY.c .generated_files/flags/default/964fce023a3f7804f660718ae9275c73cb8f8c1e .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o: IdiBusCore/Required/MEMORY.c .generated_files/flags/default/d5e0a3f622a3c23d966dfd7b6b62e4df504c81ad .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusCore/Required" @${MKDIR} "${OBJECTDIR}/IdiBusCore/Required"
@${RM} ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o.d @${RM} ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o.d
@${RM} ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o @${RM} ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/Required/MEMORY.o.d" -MT "${OBJECTDIR}/IdiBusCore/Required/MEMORY.o.d" -MT ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o -o ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o IdiBusCore/Required/MEMORY.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) ${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/Required/MEMORY.o.d" -MT "${OBJECTDIR}/IdiBusCore/Required/MEMORY.o.d" -MT ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o -o ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o IdiBusCore/Required/MEMORY.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o: IdiBusCore/Required/MODBUS_CRC.c .generated_files/flags/default/28e0ec1c4f16eabb5b730b5a3acecfd4ebb17293 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o: IdiBusCore/Required/MODBUS_CRC.c .generated_files/flags/default/59c6757c6c97bb5795d63980114e0e3dabe10f19 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusCore/Required" @${MKDIR} "${OBJECTDIR}/IdiBusCore/Required"
@${RM} ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o.d @${RM} ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o.d
@${RM} ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o @${RM} ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o.d" -MT "${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o.d" -MT ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o -o ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o IdiBusCore/Required/MODBUS_CRC.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) ${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o.d" -MT "${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o.d" -MT ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o -o ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o IdiBusCore/Required/MODBUS_CRC.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o: IdiBusCore/Required/SYSTEM.c .generated_files/flags/default/d212dba77d21ed2d462fec63f1625f7fbbde4e50 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o: IdiBusCore/Required/SYSTEM.c .generated_files/flags/default/379a7b6cd9ef82ad09306bb445e8fc1222b35185 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusCore/Required" @${MKDIR} "${OBJECTDIR}/IdiBusCore/Required"
@${RM} ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o.d @${RM} ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o.d
@${RM} ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o @${RM} ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o.d" -MT "${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o.d" -MT ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o -o ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o IdiBusCore/Required/SYSTEM.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) ${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o.d" -MT "${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o.d" -MT ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o -o ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o IdiBusCore/Required/SYSTEM.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusCore/Required/USART1.o: IdiBusCore/Required/USART1.c .generated_files/flags/default/f8adb936d6f3ea2a7c935ef712ef89bd9e0bac37 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/IdiBusCore/Required/USART1.o: IdiBusCore/Required/USART1.c .generated_files/flags/default/e431a3c715f2ed28f1ac349726ae939d24645491 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusCore/Required" @${MKDIR} "${OBJECTDIR}/IdiBusCore/Required"
@${RM} ${OBJECTDIR}/IdiBusCore/Required/USART1.o.d @${RM} ${OBJECTDIR}/IdiBusCore/Required/USART1.o.d
@${RM} ${OBJECTDIR}/IdiBusCore/Required/USART1.o @${RM} ${OBJECTDIR}/IdiBusCore/Required/USART1.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/Required/USART1.o.d" -MT "${OBJECTDIR}/IdiBusCore/Required/USART1.o.d" -MT ${OBJECTDIR}/IdiBusCore/Required/USART1.o -o ${OBJECTDIR}/IdiBusCore/Required/USART1.o IdiBusCore/Required/USART1.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) ${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/Required/USART1.o.d" -MT "${OBJECTDIR}/IdiBusCore/Required/USART1.o.d" -MT ${OBJECTDIR}/IdiBusCore/Required/USART1.o -o ${OBJECTDIR}/IdiBusCore/Required/USART1.o IdiBusCore/Required/USART1.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusCore/idibus_custom.o: IdiBusCore/idibus_custom.c .generated_files/flags/default/df0490719c3ac1a00c3f18b21d31aa0a93fe1218 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/IdiBusCore/idibus_custom.o: IdiBusCore/idibus_custom.c .generated_files/flags/default/bb6c41e49678b27546812558e3e5a44aacffa140 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusCore" @${MKDIR} "${OBJECTDIR}/IdiBusCore"
@${RM} ${OBJECTDIR}/IdiBusCore/idibus_custom.o.d @${RM} ${OBJECTDIR}/IdiBusCore/idibus_custom.o.d
@${RM} ${OBJECTDIR}/IdiBusCore/idibus_custom.o @${RM} ${OBJECTDIR}/IdiBusCore/idibus_custom.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/idibus_custom.o.d" -MT "${OBJECTDIR}/IdiBusCore/idibus_custom.o.d" -MT ${OBJECTDIR}/IdiBusCore/idibus_custom.o -o ${OBJECTDIR}/IdiBusCore/idibus_custom.o IdiBusCore/idibus_custom.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) ${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/idibus_custom.o.d" -MT "${OBJECTDIR}/IdiBusCore/idibus_custom.o.d" -MT ${OBJECTDIR}/IdiBusCore/idibus_custom.o -o ${OBJECTDIR}/IdiBusCore/idibus_custom.o IdiBusCore/idibus_custom.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusCore/idibus_hw.o: IdiBusCore/idibus_hw.c .generated_files/flags/default/e00edf63a3a14c1226c0a168de271ccec64d797d .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/IdiBusCore/idibus_hw.o: IdiBusCore/idibus_hw.c .generated_files/flags/default/da9dc502576eae6c26465a743cd0ff692d91eb24 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusCore" @${MKDIR} "${OBJECTDIR}/IdiBusCore"
@${RM} ${OBJECTDIR}/IdiBusCore/idibus_hw.o.d @${RM} ${OBJECTDIR}/IdiBusCore/idibus_hw.o.d
@${RM} ${OBJECTDIR}/IdiBusCore/idibus_hw.o @${RM} ${OBJECTDIR}/IdiBusCore/idibus_hw.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/idibus_hw.o.d" -MT "${OBJECTDIR}/IdiBusCore/idibus_hw.o.d" -MT ${OBJECTDIR}/IdiBusCore/idibus_hw.o -o ${OBJECTDIR}/IdiBusCore/idibus_hw.o IdiBusCore/idibus_hw.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) ${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/idibus_hw.o.d" -MT "${OBJECTDIR}/IdiBusCore/idibus_hw.o.d" -MT ${OBJECTDIR}/IdiBusCore/idibus_hw.o -o ${OBJECTDIR}/IdiBusCore/idibus_hw.o IdiBusCore/idibus_hw.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusCore/main.o: IdiBusCore/main.c .generated_files/flags/default/ab29b2ee9938ed03700d7711a6d436d9aea08c5f .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/IdiBusCore/main.o: IdiBusCore/main.c .generated_files/flags/default/7035e2061def77ffab54fc4f6211a13f114becfd .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusCore" @${MKDIR} "${OBJECTDIR}/IdiBusCore"
@${RM} ${OBJECTDIR}/IdiBusCore/main.o.d @${RM} ${OBJECTDIR}/IdiBusCore/main.o.d
@${RM} ${OBJECTDIR}/IdiBusCore/main.o @${RM} ${OBJECTDIR}/IdiBusCore/main.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/main.o.d" -MT "${OBJECTDIR}/IdiBusCore/main.o.d" -MT ${OBJECTDIR}/IdiBusCore/main.o -o ${OBJECTDIR}/IdiBusCore/main.o IdiBusCore/main.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) ${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/main.o.d" -MT "${OBJECTDIR}/IdiBusCore/main.o.d" -MT ${OBJECTDIR}/IdiBusCore/main.o -o ${OBJECTDIR}/IdiBusCore/main.o IdiBusCore/main.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
else else
${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o: IdiBusCore/IdiBus/IDIBUS_IMPL.c .generated_files/flags/default/deac40c0a281ab1f83c2152316fe46fde8f57998 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/components/DS3231/DS3231.o: components/DS3231/DS3231.c .generated_files/flags/default/72f82099cef6c6b2219a07033155140b2939f22 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/components/DS3231"
@${RM} ${OBJECTDIR}/components/DS3231/DS3231.o.d
@${RM} ${OBJECTDIR}/components/DS3231/DS3231.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/components/DS3231/DS3231.o.d" -MT "${OBJECTDIR}/components/DS3231/DS3231.o.d" -MT ${OBJECTDIR}/components/DS3231/DS3231.o -o ${OBJECTDIR}/components/DS3231/DS3231.o components/DS3231/DS3231.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/components/DS3231/i2cMaster.o: components/DS3231/i2cMaster.c .generated_files/flags/default/f4821df3154d6c2b20eb2bbcc5ab87cdbc115867 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/components/DS3231"
@${RM} ${OBJECTDIR}/components/DS3231/i2cMaster.o.d
@${RM} ${OBJECTDIR}/components/DS3231/i2cMaster.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/components/DS3231/i2cMaster.o.d" -MT "${OBJECTDIR}/components/DS3231/i2cMaster.o.d" -MT ${OBJECTDIR}/components/DS3231/i2cMaster.o -o ${OBJECTDIR}/components/DS3231/i2cMaster.o components/DS3231/i2cMaster.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o: IdiBusCore/IdiBus/IDIBUS_IMPL.c .generated_files/flags/default/cd005048c20b4f8408aae8d847ce275f41fb78e8 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusCore/IdiBus" @${MKDIR} "${OBJECTDIR}/IdiBusCore/IdiBus"
@${RM} ${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o.d @${RM} ${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o.d
@${RM} ${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o @${RM} ${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o.d" -MT "${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o.d" -MT ${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o -o ${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o IdiBusCore/IdiBus/IDIBUS_IMPL.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) ${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o.d" -MT "${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o.d" -MT ${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o -o ${OBJECTDIR}/IdiBusCore/IdiBus/IDIBUS_IMPL.o IdiBusCore/IdiBus/IDIBUS_IMPL.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o: IdiBusCore/IdiBus/RSLink.c .generated_files/flags/default/e9746ae4988c79472d420f21711f1dfc42ae2b92 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o: IdiBusCore/IdiBus/RSLink.c .generated_files/flags/default/c7c590bff8a3cd1ff6caac7956f76f0713d3c72c .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusCore/IdiBus" @${MKDIR} "${OBJECTDIR}/IdiBusCore/IdiBus"
@${RM} ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o.d @${RM} ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o.d
@${RM} ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o @${RM} ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o.d" -MT "${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o.d" -MT ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o -o ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o IdiBusCore/IdiBus/RSLink.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) ${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o.d" -MT "${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o.d" -MT ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o -o ${OBJECTDIR}/IdiBusCore/IdiBus/RSLink.o IdiBusCore/IdiBus/RSLink.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusCore/Required/MEMORY.o: IdiBusCore/Required/MEMORY.c .generated_files/flags/default/4b65c3af6242de005622917f3b6ee9841f75295a .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o: IdiBusCore/Required/MEMORY.c .generated_files/flags/default/6489ce70cb5491fb242d4fa2a70838316094d175 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusCore/Required" @${MKDIR} "${OBJECTDIR}/IdiBusCore/Required"
@${RM} ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o.d @${RM} ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o.d
@${RM} ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o @${RM} ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/Required/MEMORY.o.d" -MT "${OBJECTDIR}/IdiBusCore/Required/MEMORY.o.d" -MT ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o -o ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o IdiBusCore/Required/MEMORY.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) ${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/Required/MEMORY.o.d" -MT "${OBJECTDIR}/IdiBusCore/Required/MEMORY.o.d" -MT ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o -o ${OBJECTDIR}/IdiBusCore/Required/MEMORY.o IdiBusCore/Required/MEMORY.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o: IdiBusCore/Required/MODBUS_CRC.c .generated_files/flags/default/bb2a0aa9e48cf7d1572a4d94591b1b608a567b79 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o: IdiBusCore/Required/MODBUS_CRC.c .generated_files/flags/default/647a86467f894d9ed24dfdd8ac0feffafd870282 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusCore/Required" @${MKDIR} "${OBJECTDIR}/IdiBusCore/Required"
@${RM} ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o.d @${RM} ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o.d
@${RM} ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o @${RM} ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o.d" -MT "${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o.d" -MT ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o -o ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o IdiBusCore/Required/MODBUS_CRC.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) ${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o.d" -MT "${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o.d" -MT ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o -o ${OBJECTDIR}/IdiBusCore/Required/MODBUS_CRC.o IdiBusCore/Required/MODBUS_CRC.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o: IdiBusCore/Required/SYSTEM.c .generated_files/flags/default/30a7af11612c4825529cde3610ffd270273de1d .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o: IdiBusCore/Required/SYSTEM.c .generated_files/flags/default/5d83f5de92a231238f8f75df1b3ef94b8a05b409 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusCore/Required" @${MKDIR} "${OBJECTDIR}/IdiBusCore/Required"
@${RM} ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o.d @${RM} ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o.d
@${RM} ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o @${RM} ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o.d" -MT "${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o.d" -MT ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o -o ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o IdiBusCore/Required/SYSTEM.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) ${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o.d" -MT "${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o.d" -MT ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o -o ${OBJECTDIR}/IdiBusCore/Required/SYSTEM.o IdiBusCore/Required/SYSTEM.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusCore/Required/USART1.o: IdiBusCore/Required/USART1.c .generated_files/flags/default/e20dd54c9c3e9366b7e35fbede409b0e575dc648 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/IdiBusCore/Required/USART1.o: IdiBusCore/Required/USART1.c .generated_files/flags/default/66613652c2b2c02215110a36db1c06e0e2c393e8 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusCore/Required" @${MKDIR} "${OBJECTDIR}/IdiBusCore/Required"
@${RM} ${OBJECTDIR}/IdiBusCore/Required/USART1.o.d @${RM} ${OBJECTDIR}/IdiBusCore/Required/USART1.o.d
@${RM} ${OBJECTDIR}/IdiBusCore/Required/USART1.o @${RM} ${OBJECTDIR}/IdiBusCore/Required/USART1.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/Required/USART1.o.d" -MT "${OBJECTDIR}/IdiBusCore/Required/USART1.o.d" -MT ${OBJECTDIR}/IdiBusCore/Required/USART1.o -o ${OBJECTDIR}/IdiBusCore/Required/USART1.o IdiBusCore/Required/USART1.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) ${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/Required/USART1.o.d" -MT "${OBJECTDIR}/IdiBusCore/Required/USART1.o.d" -MT ${OBJECTDIR}/IdiBusCore/Required/USART1.o -o ${OBJECTDIR}/IdiBusCore/Required/USART1.o IdiBusCore/Required/USART1.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusCore/idibus_custom.o: IdiBusCore/idibus_custom.c .generated_files/flags/default/c3d42a8848cfe26e389c6f774eeaf6abeccfac8e .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/IdiBusCore/idibus_custom.o: IdiBusCore/idibus_custom.c .generated_files/flags/default/bf2fde24ac6c3b2e1ed27f7b2984cd7479c9656b .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusCore" @${MKDIR} "${OBJECTDIR}/IdiBusCore"
@${RM} ${OBJECTDIR}/IdiBusCore/idibus_custom.o.d @${RM} ${OBJECTDIR}/IdiBusCore/idibus_custom.o.d
@${RM} ${OBJECTDIR}/IdiBusCore/idibus_custom.o @${RM} ${OBJECTDIR}/IdiBusCore/idibus_custom.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/idibus_custom.o.d" -MT "${OBJECTDIR}/IdiBusCore/idibus_custom.o.d" -MT ${OBJECTDIR}/IdiBusCore/idibus_custom.o -o ${OBJECTDIR}/IdiBusCore/idibus_custom.o IdiBusCore/idibus_custom.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) ${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/idibus_custom.o.d" -MT "${OBJECTDIR}/IdiBusCore/idibus_custom.o.d" -MT ${OBJECTDIR}/IdiBusCore/idibus_custom.o -o ${OBJECTDIR}/IdiBusCore/idibus_custom.o IdiBusCore/idibus_custom.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusCore/idibus_hw.o: IdiBusCore/idibus_hw.c .generated_files/flags/default/d5b34525c4a66132f29addca6aba3792d3300f55 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/IdiBusCore/idibus_hw.o: IdiBusCore/idibus_hw.c .generated_files/flags/default/85e7255b11423cb24ed1ba94824b46f2d7264f30 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusCore" @${MKDIR} "${OBJECTDIR}/IdiBusCore"
@${RM} ${OBJECTDIR}/IdiBusCore/idibus_hw.o.d @${RM} ${OBJECTDIR}/IdiBusCore/idibus_hw.o.d
@${RM} ${OBJECTDIR}/IdiBusCore/idibus_hw.o @${RM} ${OBJECTDIR}/IdiBusCore/idibus_hw.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/idibus_hw.o.d" -MT "${OBJECTDIR}/IdiBusCore/idibus_hw.o.d" -MT ${OBJECTDIR}/IdiBusCore/idibus_hw.o -o ${OBJECTDIR}/IdiBusCore/idibus_hw.o IdiBusCore/idibus_hw.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) ${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/idibus_hw.o.d" -MT "${OBJECTDIR}/IdiBusCore/idibus_hw.o.d" -MT ${OBJECTDIR}/IdiBusCore/idibus_hw.o -o ${OBJECTDIR}/IdiBusCore/idibus_hw.o IdiBusCore/idibus_hw.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusCore/main.o: IdiBusCore/main.c .generated_files/flags/default/6b86ad118a826c8373ddd5d6f367cc4f4dfaaa2 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/IdiBusCore/main.o: IdiBusCore/main.c .generated_files/flags/default/11cb3fdede3c3e0bc7601382ea36e8f9a9e9af7 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/IdiBusCore" @${MKDIR} "${OBJECTDIR}/IdiBusCore"
@${RM} ${OBJECTDIR}/IdiBusCore/main.o.d @${RM} ${OBJECTDIR}/IdiBusCore/main.o.d
@${RM} ${OBJECTDIR}/IdiBusCore/main.o @${RM} ${OBJECTDIR}/IdiBusCore/main.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/main.o.d" -MT "${OBJECTDIR}/IdiBusCore/main.o.d" -MT ${OBJECTDIR}/IdiBusCore/main.o -o ${OBJECTDIR}/IdiBusCore/main.o IdiBusCore/main.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) ${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusCore/main.o.d" -MT "${OBJECTDIR}/IdiBusCore/main.o.d" -MT ${OBJECTDIR}/IdiBusCore/main.o -o ${OBJECTDIR}/IdiBusCore/main.o IdiBusCore/main.c -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
endif endif
# ------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------
# Rules for buildStep: compileCPP # Rules for buildStep: compileCPP
ifeq ($(TYPE_IMAGE), DEBUG_RUN) ifeq ($(TYPE_IMAGE), DEBUG_RUN)
${OBJECTDIR}/IdiBusSlave.o: IdiBusSlave.cpp .generated_files/flags/default/2f96a12a4d5605dd7d4b5320fe366ca7335deefc .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/components/Serial.o: components/Serial.cpp .generated_files/flags/default/8fcc39c7d89bf344ed713ab9b0cafd1d950b4274 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/components"
@${RM} ${OBJECTDIR}/components/Serial.o.d
@${RM} ${OBJECTDIR}/components/Serial.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c++ -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/components/Serial.o.d" -MT "${OBJECTDIR}/components/Serial.o.d" -MT ${OBJECTDIR}/components/Serial.o -o ${OBJECTDIR}/components/Serial.o components/Serial.cpp -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusSlave.o: IdiBusSlave.cpp .generated_files/flags/default/83436abf1f13efcdacae23c23d8225887da720bf .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}" @${MKDIR} "${OBJECTDIR}"
@${RM} ${OBJECTDIR}/IdiBusSlave.o.d @${RM} ${OBJECTDIR}/IdiBusSlave.o.d
@${RM} ${OBJECTDIR}/IdiBusSlave.o @${RM} ${OBJECTDIR}/IdiBusSlave.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c++ -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave.o.d" -MT "${OBJECTDIR}/IdiBusSlave.o.d" -MT ${OBJECTDIR}/IdiBusSlave.o -o ${OBJECTDIR}/IdiBusSlave.o IdiBusSlave.cpp -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) ${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -g -DDEBUG -gdwarf-2 -x c++ -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave.o.d" -MT "${OBJECTDIR}/IdiBusSlave.o.d" -MT ${OBJECTDIR}/IdiBusSlave.o -o ${OBJECTDIR}/IdiBusSlave.o IdiBusSlave.cpp -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
else else
${OBJECTDIR}/IdiBusSlave.o: IdiBusSlave.cpp .generated_files/flags/default/c1972d05bd292e9c5488c0069d0a205bff09c5d .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/components/Serial.o: components/Serial.cpp .generated_files/flags/default/172261e5988e0bda69a64282f5d4b9236e1a0e3a .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/components"
@${RM} ${OBJECTDIR}/components/Serial.o.d
@${RM} ${OBJECTDIR}/components/Serial.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c++ -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/components/Serial.o.d" -MT "${OBJECTDIR}/components/Serial.o.d" -MT ${OBJECTDIR}/components/Serial.o -o ${OBJECTDIR}/components/Serial.o components/Serial.cpp -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
${OBJECTDIR}/IdiBusSlave.o: IdiBusSlave.cpp .generated_files/flags/default/a74bbcadb7d2e80a057d3584c526c3f5b6668a6d .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}" @${MKDIR} "${OBJECTDIR}"
@${RM} ${OBJECTDIR}/IdiBusSlave.o.d @${RM} ${OBJECTDIR}/IdiBusSlave.o.d
@${RM} ${OBJECTDIR}/IdiBusSlave.o @${RM} ${OBJECTDIR}/IdiBusSlave.o
${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega328pb ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c++ -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave.o.d" -MT "${OBJECTDIR}/IdiBusSlave.o.d" -MT ${OBJECTDIR}/IdiBusSlave.o -o ${OBJECTDIR}/IdiBusSlave.o IdiBusSlave.cpp -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) ${MP_CPPC} $(MP_EXTRA_CC_PRE) -mmcu=atmega1280 ${PACK_COMPILER_OPTIONS} ${PACK_COMMON_OPTIONS} -x c++ -c -D__$(MP_PROCESSOR_OPTION)__ -I"IdiBusCore" -I"IdiBusCore/IdiBus" -I"IdiBusCore/Required" -I"components" -I"components/FatFS" -I"components/DS3231" -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -MD -MP -MF "${OBJECTDIR}/IdiBusSlave.o.d" -MT "${OBJECTDIR}/IdiBusSlave.o.d" -MT ${OBJECTDIR}/IdiBusSlave.o -o ${OBJECTDIR}/IdiBusSlave.o IdiBusSlave.cpp -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD)
endif endif
# ------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------
# Rules for buildStep: link # Rules for buildStep: link
ifeq ($(TYPE_IMAGE), DEBUG_RUN) ifeq ($(TYPE_IMAGE), DEBUG_RUN)
${DISTDIR}/IdiBusSlaveTemplate.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk ${DISTDIR}/IdiBus_Logger.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${DISTDIR} @${MKDIR} ${DISTDIR}
${MP_CPPC} $(MP_EXTRA_LD_PRE) -mmcu=atmega328pb ${PACK_COMMON_OPTIONS} -gdwarf-2 -D__$(MP_PROCESSOR_OPTION)__ -Wl,-Map="${DISTDIR}\IdiBusSlaveTemplate.${IMAGE_TYPE}.map" -Wl,-section-start=.serialdata=0x810000 -Wl,-section-start=.eeprom=0x810040 -o ${DISTDIR}/IdiBusSlaveTemplate.${IMAGE_TYPE}.${OUTPUT_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -Wl,--defsym=__MPLAB_BUILD=1$(MP_EXTRA_LD_POST)$(MP_LINKER_FILE_OPTION),--defsym=__ICD2RAM=1,--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1 -Wl,--gc-sections -Wl,--start-group -Wl,-lm -Wl,--end-group ${MP_CPPC} $(MP_EXTRA_LD_PRE) -mmcu=atmega1280 ${PACK_COMMON_OPTIONS} -gdwarf-2 -D__$(MP_PROCESSOR_OPTION)__ -Wl,-Map="${DISTDIR}\IdiBus_Logger.${IMAGE_TYPE}.map" -Wl,-section-start=.serialdata=0x810000 -Wl,-section-start=.eeprom=0x810040 -o ${DISTDIR}/IdiBus_Logger.${IMAGE_TYPE}.${OUTPUT_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -Wl,--defsym=__MPLAB_BUILD=1$(MP_EXTRA_LD_POST)$(MP_LINKER_FILE_OPTION),--defsym=__ICD2RAM=1,--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1 -Wl,--gc-sections -Wl,--start-group -Wl,-lm -Wl,--end-group
@ -268,10 +304,10 @@ ${DISTDIR}/IdiBusSlaveTemplate.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} n
else else
${DISTDIR}/IdiBusSlaveTemplate.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk ${DISTDIR}/IdiBus_Logger.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${DISTDIR} @${MKDIR} ${DISTDIR}
${MP_CPPC} $(MP_EXTRA_LD_PRE) -mmcu=atmega328pb ${PACK_COMMON_OPTIONS} -D__$(MP_PROCESSOR_OPTION)__ -Wl,-Map="${DISTDIR}\IdiBusSlaveTemplate.${IMAGE_TYPE}.map" -Wl,-section-start=.serialdata=0x810000 -Wl,-section-start=.eeprom=0x810040 -o ${DISTDIR}/IdiBusSlaveTemplate.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -Wl,--defsym=__MPLAB_BUILD=1$(MP_EXTRA_LD_POST)$(MP_LINKER_FILE_OPTION) -Wl,--gc-sections -Wl,--start-group -Wl,-lm -Wl,--end-group ${MP_CPPC} $(MP_EXTRA_LD_PRE) -mmcu=atmega1280 ${PACK_COMMON_OPTIONS} -D__$(MP_PROCESSOR_OPTION)__ -Wl,-Map="${DISTDIR}\IdiBus_Logger.${IMAGE_TYPE}.map" -Wl,-section-start=.serialdata=0x810000 -Wl,-section-start=.eeprom=0x810040 -o ${DISTDIR}/IdiBus_Logger.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -Wl,--defsym=__MPLAB_BUILD=1$(MP_EXTRA_LD_POST)$(MP_LINKER_FILE_OPTION) -Wl,--gc-sections -Wl,--start-group -Wl,-lm -Wl,--end-group
${MP_CC_DIR}\\avr-objcopy -O ihex "${DISTDIR}/IdiBusSlaveTemplate.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX}" "${DISTDIR}/IdiBusSlaveTemplate.${IMAGE_TYPE}.hex" ${MP_CC_DIR}\\avr-objcopy -O ihex "${DISTDIR}/IdiBus_Logger.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX}" "${DISTDIR}/IdiBus_Logger.${IMAGE_TYPE}.hex"

@ -1,13 +1,13 @@
# #
#Wed May 13 12:30:51 MSK 2026 #Wed Jun 17 19:22:07 MSK 2026
default.languagetoolchain.version=14.2.0 default.languagetoolchain.version=14.2.0
default.Pack.dfplocation=C\:\\Users\\Michail\\.mchp_packs\\Microchip\\ATmega_DFP\\3.5.296 default.Pack.dfplocation=C\:\\Users\\Michail\\.mchp_packs\\Microchip\\ATmega_DFP\\3.5.296
default.com-microchip-mplab-nbide-toolchain-avr-AVRLanguageToolchain.md5=7077cb0f7d3286937e616ce3e96e957a default.com-microchip-mplab-nbide-toolchain-avr-AVRLanguageToolchain.md5=7077cb0f7d3286937e616ce3e96e957a
conf.ids=default conf.ids=default
default.languagetoolchain.dir=C\:\\Users\\Michail\\AVR\\cooler_tool\\bin default.languagetoolchain.dir=C\:\\Users\\Michail\\AVR\\cooler_tool\\bin
host.id=j20m-9n47-m host.id=1au8-yc59-u8
default.platformTool.md5=null default.platformTool.md5=null
configurations-xml=815e4f33c4f6d31852ae21c189ccfa12 configurations-xml=f542f1386b31395cd747c126941e36e0
com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=6cd85c1014597ae4d039afea70fe46c5 com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=6cd85c1014597ae4d039afea70fe46c5
proj.dir=P\:\\IdiBus\\Atmega\\IdiBusSlaveTemplate proj.dir=C\:\\Users\\Michail\\MPLABXProjects\\IdiBus_Logger
host.platform=windows host.platform=windows

@ -24,7 +24,7 @@ CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
# Project Name # Project Name
PROJECTNAME=IdiBusSlaveTemplate PROJECTNAME=IdiBus_Logger
# Active Configuration # Active Configuration
DEFAULTCONF=default DEFAULTCONF=default

@ -6,5 +6,5 @@
CND_BASEDIR=`pwd` CND_BASEDIR=`pwd`
# default configuration # default configuration
CND_ARTIFACT_DIR_default=dist/default/production CND_ARTIFACT_DIR_default=dist/default/production
CND_ARTIFACT_NAME_default=IdiBusSlaveTemplate.production.hex CND_ARTIFACT_NAME_default=IdiBus_Logger.production.hex
CND_ARTIFACT_PATH_default=dist/default/production/IdiBusSlaveTemplate.production.hex CND_ARTIFACT_PATH_default=dist/default/production/IdiBus_Logger.production.hex

@ -4,6 +4,13 @@
<logicalFolder name="HeaderFiles" <logicalFolder name="HeaderFiles"
displayName="Header Files" displayName="Header Files"
projectFiles="true"> projectFiles="true">
<logicalFolder name="components" displayName="components" projectFiles="true">
<logicalFolder name="DS3231" displayName="DS3231" projectFiles="true">
<itemPath>components/DS3231/DS3231.h</itemPath>
<itemPath>components/DS3231/i2cMaster.h</itemPath>
</logicalFolder>
<itemPath>components/Serial.h</itemPath>
</logicalFolder>
<logicalFolder name="IdiBusCore" displayName="IdiBusCore" projectFiles="true"> <logicalFolder name="IdiBusCore" displayName="IdiBusCore" projectFiles="true">
<logicalFolder name="IdiBus" displayName="IdiBus" projectFiles="true"> <logicalFolder name="IdiBus" displayName="IdiBus" projectFiles="true">
<itemPath>IdiBusCore/IdiBus/IDIBUS_DEFS.h</itemPath> <itemPath>IdiBusCore/IdiBus/IDIBUS_DEFS.h</itemPath>
@ -39,6 +46,13 @@
<logicalFolder name="SourceFiles" <logicalFolder name="SourceFiles"
displayName="Source Files" displayName="Source Files"
projectFiles="true"> projectFiles="true">
<logicalFolder name="components" displayName="components" projectFiles="true">
<logicalFolder name="DS3231" displayName="DS3231" projectFiles="true">
<itemPath>components/DS3231/DS3231.c</itemPath>
<itemPath>components/DS3231/i2cMaster.c</itemPath>
</logicalFolder>
<itemPath>components/Serial.cpp</itemPath>
</logicalFolder>
<logicalFolder name="IdiBusCore" displayName="IdiBusCore" projectFiles="true"> <logicalFolder name="IdiBusCore" displayName="IdiBusCore" projectFiles="true">
<logicalFolder name="IdiBus" displayName="IdiBus" projectFiles="true"> <logicalFolder name="IdiBus" displayName="IdiBus" projectFiles="true">
<itemPath>IdiBusCore/IdiBus/IDIBUS_IMPL.c</itemPath> <itemPath>IdiBusCore/IdiBus/IDIBUS_IMPL.c</itemPath>
@ -65,7 +79,7 @@
<conf name="default" type="2"> <conf name="default" type="2">
<toolsSet> <toolsSet>
<developmentServer>localhost</developmentServer> <developmentServer>localhost</developmentServer>
<targetDevice>ATmega328PB</targetDevice> <targetDevice>ATmega1280</targetDevice>
<targetHeader></targetHeader> <targetHeader></targetHeader>
<targetPluginBoard></targetPluginBoard> <targetPluginBoard></targetPluginBoard>
<platformTool>noID</platformTool> <platformTool>noID</platformTool>
@ -189,7 +203,7 @@
</AVR-GCC> </AVR-GCC>
<AVR-Global> <AVR-Global>
<property key="common-include-directories" <property key="common-include-directories"
value="IdiBusCore;IdiBusCore\IdiBus;IdiBusCore\Required"/> value="IdiBusCore;IdiBusCore\IdiBus;IdiBusCore\Required;components;components\FatFS;components\DS3231"/>
<property key="eep" value="false"/> <property key="eep" value="false"/>
<property key="external-ram-check" value="false"/> <property key="external-ram-check" value="false"/>
<property key="hex" value="true"/> <property key="hex" value="true"/>
@ -252,6 +266,8 @@
value="${memories.instruction.ram.ranges}"/> value="${memories.instruction.ram.ranges}"/>
<property key="memories.programmemory" value="true"/> <property key="memories.programmemory" value="true"/>
<property key="memories.programmemory.ranges" value="0-1ffff"/> <property key="memories.programmemory.ranges" value="0-1ffff"/>
<property key="programmerToGoFilePath"
value="C:/Users/Michail/MPLABXProjects/IdiBus_Logger/debug/default/default_ptg"/>
<property key="programoptions.donoteraseauxmem" value="false"/> <property key="programoptions.donoteraseauxmem" value="false"/>
<property key="programoptions.eraseb4program" value="true"/> <property key="programoptions.eraseb4program" value="true"/>
<property key="programoptions.pgmentry.voltage" value="low"/> <property key="programoptions.pgmentry.voltage" value="low"/>

@ -0,0 +1,4 @@
#
#Tue Jun 16 15:51:04 MSK 2026
realice/DEVID_MISMATCH=true
configchecker/AVR_MIGHT_AFFECT_PRODUCTION=true

@ -2,6 +2,12 @@
<project-private xmlns="http://www.netbeans.org/ns/project-private/1"> <project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2"> <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group/> <group>
<file>file:/C:/Users/Michail/MPLABXProjects/IdiBus_Logger/IdiBusSlave.cpp</file>
<file>file:/C:/Users/Michail/MPLABXProjects/IdiBus_Logger/IdiBusCore/Required/SYSTEM.c</file>
<file>file:/C:/Users/Michail/MPLABXProjects/IdiBus_Logger/IdiBusCore/Required/USART1.c</file>
<file>file:/C:/Users/Michail/MPLABXProjects/IdiBus_Logger/components/FatFS/mmc_avr_spi.c</file>
<file>file:/C:/Users/Michail/MPLABXProjects/IdiBus_Logger/IdiBusCore/main.c</file>
</group>
</open-files> </open-files>
</project-private> </project-private>

@ -3,10 +3,10 @@
<type>com.microchip.mplab.nbide.embedded.makeproject</type> <type>com.microchip.mplab.nbide.embedded.makeproject</type>
<configuration> <configuration>
<data xmlns="http://www.netbeans.org/ns/make-project/1"> <data xmlns="http://www.netbeans.org/ns/make-project/1">
<name>IdiBusSlaveTemplate</name> <name>IdiBus_Logger</name>
<creation-uuid>ba3551bc-e288-4eb1-944a-64a3b567ee1c</creation-uuid> <creation-uuid>ba3551bc-e288-4eb1-944a-64a3b567ee1c</creation-uuid>
<make-project-type>0</make-project-type> <make-project-type>0</make-project-type>
<sourceEncoding>ISO-8859-1</sourceEncoding> <sourceEncoding>windows-1251</sourceEncoding>
<make-dep-projects> <make-dep-projects>
<make-dep-project>../IdibusBootloader2560.X</make-dep-project> <make-dep-project>../IdibusBootloader2560.X</make-dep-project>
</make-dep-projects> </make-dep-projects>

Loading…
Cancel
Save