Skip to content

Commit

Permalink
Merge pull request #19 from emotional-cities/fw-raise_harp_core_to_1.13
Browse files Browse the repository at this point in the history
Raise harp core to 1.13
  • Loading branch information
filcarv authored Sep 4, 2023
2 parents 03feddf + 03a4e66 commit 5e53460
Show file tree
Hide file tree
Showing 28 changed files with 363 additions and 67 deletions.
Binary file removed Firmware/EmotionalCities/libATxmega32A4U-1.7.a
Binary file not shown.
Binary file removed Firmware/EmotionalCities/libATxmega32A4U-1.9.a
Binary file not shown.
2 changes: 1 addition & 1 deletion Firmware/Pluma.atsln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Atmel Studio Solution File, Format Version 11.00
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "Pluma", "EmotionalCities\Pluma.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "Pluma", "Pluma\Pluma.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
101 changes: 48 additions & 53 deletions Firmware/EmotionalCities/Pluma.cproj → Firmware/Pluma/Pluma.cproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,50 +72,6 @@
<ExternalProgrammingToolCommand />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<ToolchainSettings>
<AvrGcc>
<avrgcc.common.Device>-mmcu=atxmega32a4u -B "%24(PackRepoDir)\atmel\XMEGAA_DFP\1.1.68\gcc\dev\atxmega32a4u"</avrgcc.common.Device>
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
<avrgcc.compiler.symbols.DefSymbols>
<ListValues>
<Value>NDEBUG</Value>
</ListValues>
</avrgcc.compiler.symbols.DefSymbols>
<avrgcc.compiler.directories.IncludePaths>
<ListValues>
<Value>..</Value>
<Value>%24(PackRepoDir)\atmel\XMEGAA_DFP\1.1.68\include</Value>
</ListValues>
</avrgcc.compiler.directories.IncludePaths>
<avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
<avrgcc.linker.libraries.Libraries>
<ListValues>
<Value>libATxmega32A4U-1.9.a</Value>
</ListValues>
</avrgcc.linker.libraries.Libraries>
<avrgcc.linker.libraries.LibrarySearchPaths>
<ListValues>
<Value>..</Value>
</ListValues>
</avrgcc.linker.libraries.LibrarySearchPaths>
<avrgcc.assembler.general.IncludePaths>
<ListValues>
<Value>%24(PackRepoDir)\atmel\XMEGAA_DFP\1.1.68\include</Value>
</ListValues>
</avrgcc.assembler.general.IncludePaths>
</AvrGcc>
</ToolchainSettings>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<ToolchainSettings>
<AvrGcc>
<avrgcc.common.Device>-mmcu=atxmega32a4u -B "%24(PackRepoDir)\atmel\XMEGAA_DFP\1.1.68\gcc\dev\atxmega32a4u"</avrgcc.common.Device>
Expand All @@ -128,7 +84,7 @@
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
<avrgcc.compiler.symbols.DefSymbols>
<ListValues>
<Value>DEBUG</Value>
<Value>NDEBUG</Value>
</ListValues>
</avrgcc.compiler.symbols.DefSymbols>
<avrgcc.compiler.directories.IncludePaths>
Expand All @@ -137,10 +93,9 @@
<Value>%24(PackRepoDir)\atmel\XMEGAA_DFP\1.1.68\include</Value>
</ListValues>
</avrgcc.compiler.directories.IncludePaths>
<avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
<avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
<avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
<avrgcc.linker.libraries.Libraries>
<ListValues>
Expand All @@ -157,10 +112,55 @@
<Value>%24(PackRepoDir)\atmel\XMEGAA_DFP\1.1.68\include</Value>
</ListValues>
</avrgcc.assembler.general.IncludePaths>
<avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
</AvrGcc>
</ToolchainSettings>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<ToolchainSettings>
<AvrGcc>
<avrgcc.common.Device>-mmcu=atxmega32a4u -B "%24(PackRepoDir)\atmel\XMEGAA_DFP\1.1.68\gcc\dev\atxmega32a4u"</avrgcc.common.Device>
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
<avrgcc.compiler.symbols.DefSymbols>
<ListValues>
<Value>DEBUG</Value>
</ListValues>
</avrgcc.compiler.symbols.DefSymbols>
<avrgcc.compiler.directories.IncludePaths>
<ListValues>
<Value>..</Value>
<Value>%24(PackRepoDir)\atmel\XMEGAA_DFP\1.1.68\include</Value>
</ListValues>
</avrgcc.compiler.directories.IncludePaths>
<avrgcc.compiler.optimization.level>Optimize most (-O3)</avrgcc.compiler.optimization.level>
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
<avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
<avrgcc.linker.libraries.Libraries>
<ListValues>
<Value>libATxmega32A4U-1.13.a</Value>
</ListValues>
</avrgcc.linker.libraries.Libraries>
<avrgcc.linker.libraries.LibrarySearchPaths>
<ListValues>
<Value>..</Value>
</ListValues>
</avrgcc.linker.libraries.LibrarySearchPaths>
<avrgcc.assembler.general.IncludePaths>
<ListValues>
<Value>%24(PackRepoDir)\atmel\XMEGAA_DFP\1.1.68\include</Value>
</ListValues>
</avrgcc.assembler.general.IncludePaths>
<avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
</AvrGcc>
</ToolchainSettings>
</PropertyGroup>
<ItemGroup>
<Compile Include="app.c">
<SubType>compile</SubType>
Expand Down Expand Up @@ -223,10 +223,5 @@
<SubType>compile</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="desktop.ini">
<SubType>compile</SubType>
</None>
</ItemGroup>
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
</Project>
22 changes: 18 additions & 4 deletions Firmware/EmotionalCities/app.c → Firmware/Pluma/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extern i2c_dev_t oximeter;
/************************************************************************/
/* Initialize app */
/************************************************************************/
static const uint8_t default_device_name[] = "BioReader";
static const uint8_t default_device_name[] = "Pluma";
uint16_t heartRate;
uint8_t confidence;
uint16_t oxygen;
Expand All @@ -37,7 +37,7 @@ uint8_t data[6];
void hwbp_app_initialize(void)
{
/* Define versions */
uint8_t hwH = 0;
uint8_t hwH = 1;
uint8_t hwL = 1;
uint8_t fwH = 0;
uint8_t fwL = 5;
Expand All @@ -52,7 +52,10 @@ void hwbp_app_initialize(void)
(uint8_t*)(&app_regs),
APP_NBYTES_OF_REG_BANK,
APP_REGS_ADD_MAX - APP_REGS_ADD_MIN + 1,
default_device_name
default_device_name,
false, // The device is _not_ able to repeat the harp timestamp clock
false, // The device is _not_ able to generate the harp timestamp clock
0 // Default timestamp offset
);
}

Expand All @@ -73,7 +76,10 @@ void core_callback_catastrophic_error_detected(void)
/* Initialization Callbacks */
/************************************************************************/
bool i_;
void core_callback_1st_config_hw_after_boot(void)

void core_callback_define_clock_default(void) {}

void core_callback_initialize_hardware(void)
{
/* Initialize IOs */
/* Don't delete this function!!! */
Expand Down Expand Up @@ -288,6 +294,14 @@ void core_callback_t_1ms(void)
*/
}

/************************************************************************/
/* Callbacks: cloc control */
/************************************************************************/
void core_callback_clock_to_repeater(void) {}
void core_callback_clock_to_generator(void) {}
void core_callback_clock_to_unlock(void) {}
void core_callback_clock_to_lock(void) {}

/************************************************************************/
/* Callbacks: uart control */
/************************************************************************/
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions Firmware/EmotionalCities/cpu.h → Firmware/Pluma/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ void timer_type1_wait(TC1_t* timer, uint8_t prescaler, uint16_t target_count);
/************************************************************************/
/* EEPROM */
/************************************************************************/
bool eeprom_is_busy(void);

uint8_t eeprom_rd_byte(uint16_t addr);
void eeprom_wr_byte(uint16_t addr, uint8_t byte);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ typedef struct {
uint16_t usecond;
} timestamp_t;

// Used to define the clock direction default of the device.
void core_callback_define_clock_default(void);

// It's the first callback used, right after booting the core.
// The pins, ports and external hardware should be initialized.
void core_callback_1st_config_hw_after_boot(void);
void core_callback_initialize_hardware(void);

// Used to initialize the registers.
// All registers should be written to their default state.
Expand All @@ -43,7 +46,6 @@ void core_callback_device_to_active(void);
void core_callback_device_to_speed(void);



// Called before execute the timer interrupts
void core_callback_t_before_exec(void);
// Called after execute the timer interrupts
Expand All @@ -57,7 +59,6 @@ void core_callback_t_500us(void);
void core_callback_t_new_second(void);



// Read from an application register.
bool core_read_app_register(uint8_t add, uint8_t type);
// Write to an application register.
Expand All @@ -68,6 +69,48 @@ bool hwbp_read_common_reg(uint8_t add, uint8_t type);
bool hwbp_write_common_reg(uint8_t add, uint8_t type, uint8_t * content, uint16_t n_elements);


/************************************************************************/
/* Register RESET_APP */
/************************************************************************/
// Write to common register RESET_APP.
bool hwbp_write_common_reg_RESET_APP(void *a);

// Used to save all registers to non-volatile memory
bool core_save_all_registers_to_eeprom(void);


/************************************************************************/
/* Register CONFIG */
/************************************************************************/
// Write to common register CONFIG.
bool hwbp_write_common_reg_CONFIG(void *a);
// Read from common register CONFIG.
void hwbp_read_common_reg_CONFIG(void);

// Called when the application should configure the hardware to repeat the harp timestamp clock input.
void core_callback_clock_to_repeater(void);
// Called when the application should configure the hardware to generate the harp timestamp clock.
void core_callback_clock_to_generator(void);
// Called when the timestamp lock is changed to unlocked.
void core_callback_clock_to_unlock(void);
// Called when the timestamp lock is changed to locked.
void core_callback_clock_to_lock(void);

// Used to know if the device is repeating the harp timestamp clock
bool core_bool_device_is_repeater(void);
// Used to know if the device is generating the harp timestamp clock
bool core_bool_device_is_generator(void);
// Used to check if the timestamp register is locked
bool core_bool_clock_is_locked(void);

// Used to set the device as a repeater
bool core_device_to_clock_repeater(void);
// Used to set the device as a generator
bool core_device_to_clock_generator(void);
// Used to lock the timestamp register
bool core_clock_to_lock(void);
// Used to unlock the timestamp register
bool core_clock_to_unlock(void);


// It is mandatory that this function is the first of the application code.
Expand All @@ -81,7 +124,11 @@ void core_func_start_core (
uint8_t *pointer_to_app_regs,
const uint16_t app_mem_size_to_save,
const uint8_t num_of_app_registers,
const uint8_t *device_name);
const uint8_t *device_name,
const bool device_is_able_to_repeat_clock,
const bool device_is_able_to_generate_clock,
const uint8_t default_timestamp_offset
);

// Call this function in case of error
// A power up or reset must be performed to remove the device from this state
Expand Down Expand Up @@ -113,6 +160,7 @@ uint16_t core_func_read_R_TIMESTAMP_MICRO(void);




// Return "true" if the LEDs can be ON.
bool core_bool_is_visual_enabled(void);
// Return "true" if the device is in Speed Mode.
Expand Down
Loading

0 comments on commit 5e53460

Please sign in to comment.