Skip to content

Commit

Permalink
ifdef for nessie test, moving mooltipass setting reset in main fw whe…
Browse files Browse the repository at this point in the history
…n changes in layout occur (updates...)
  • Loading branch information
limpkin committed Mar 18, 2016
1 parent 44adfc1 commit 6fec359
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 13 deletions.
Binary file modified source_code/.vs/Mooltipass/v14/.atsuo
Binary file not shown.
2 changes: 2 additions & 0 deletions source_code/src/AES/aes256_nessie_test.c
Expand Up @@ -34,6 +34,7 @@
#include "aes256_nessie_test.h"
#include "aes.h"
#include "utils.h"
#ifdef NESSIE_TEST_VECTORS

/*! \var int8_t (*nessieOutput)(uint8_t ch)
* \brief function pointer to the output function
Expand Down Expand Up @@ -570,3 +571,4 @@ void nessieTest(uint8_t setnum)
} /* end for loop */

} /* end nessieTest call */
#endif
2 changes: 2 additions & 0 deletions source_code/src/AES/aes256_nessie_test.h
Expand Up @@ -29,10 +29,12 @@

#include <stdint.h>

#ifdef NESSIE_TEST_VECTORS
/*! \brief function pointer to the output function */
int8_t (*nessieOutput)(uint8_t ch);

// prototype functions
void nessieTest(uint8_t setnum);
#endif

#endif /*__AES256_NESSIE_TEST_H__*/
1 change: 1 addition & 0 deletions source_code/src/OLEDMP/oledmp.c
Expand Up @@ -51,6 +51,7 @@

#include "logic_fwflash_storage.h"
#include "timer_manager.h"
#include "oled_wrapper.h"
#include "bitstream.h"
#include "flash_mem.h"
#include "node_mgmt.h"
Expand Down
8 changes: 4 additions & 4 deletions source_code/src/USB/usb_cmd_parser.c
Expand Up @@ -65,8 +65,6 @@ uint16_t flashOpCurAddr2;
// Bool to know if the user approved memory management mode
uint8_t memoryManagementModeApproved = FALSE;
#endif
// Our Mooltipass version that will be returned to our application
const char mooltipass_version[] = FLASH_CHIP_STR "" MOOLTIPASS_VERSION;
// Bool to know if we can import in the media part of flash
uint8_t mediaFlashImportApproved = FALSE;
// Current node we're writing
Expand Down Expand Up @@ -295,7 +293,7 @@ void usbProcessIncoming(uint8_t caller_id)
}

// Check that we are in node mangement mode when needed
if ((datacmd >= FIRST_CMD_FOR_DATAMGMT) && (datacmd <= LAST_CMD_FOR_DATA8MGMT) && (memoryManagementModeApproved == FALSE))
if ((datacmd >= FIRST_CMD_FOR_DATAMGMT) && (datacmd <= LAST_CMD_FOR_DATAMGMT) && (memoryManagementModeApproved == FALSE))
{
// Return an error that was defined before (ERROR)
usbSendMessage(datacmd, 1, &plugin_return_value);
Expand All @@ -314,7 +312,9 @@ void usbProcessIncoming(uint8_t caller_id)

// version command
case CMD_VERSION :
{
{
// Our Mooltipass version that will be returned to our application
const char mooltipass_version[] = FLASH_CHIP_STR "" MOOLTIPASS_VERSION;
usbSendMessage(CMD_VERSION, sizeof(mooltipass_version), mooltipass_version);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion source_code/src/USB/usb_cmd_parser.h
Expand Up @@ -87,7 +87,7 @@
#define CMD_SET_DN_START_PARENT 0xD2
#define CMD_END_MEMORYMGMT 0xD3
#define FIRST_CMD_FOR_DATAMGMT CMD_READ_FLASH_NODE
#define LAST_CMD_FOR_DATA8MGMT CMD_END_MEMORYMGMT
#define LAST_CMD_FOR_DATAMGMT CMD_END_MEMORYMGMT

/* Packet format defines */
#define HID_LEN_FIELD 0x00
Expand Down
1 change: 1 addition & 0 deletions source_code/src/changelog.txt
Expand Up @@ -7,6 +7,7 @@ Todo:
- allow pin entering through usb comms with user approval
- shortcut to generate random password in device
- get description command
- bytes in eeprom to set shortcuts?

V1.1:
- post-indiegogo firmware
Expand Down
2 changes: 1 addition & 1 deletion source_code/src/defines.h
Expand Up @@ -58,7 +58,7 @@
* MINI_CLICK_BETATESTERS_SETUP
* => mini beta testing units with click scroll wheel, sent to the beta testers
*/
#define MINI_CLICK_BETATESTERS_SETUP
#define BETATESTERS_SETUP_PIN
#if defined(BETATESTERS_SETUP)
#define FLASH_CHIP_32M
#define JTAG_FUSE_ENABLED
Expand Down
2 changes: 2 additions & 0 deletions source_code/src/functional_testing.c
Expand Up @@ -170,6 +170,7 @@ void mooltipassStandardElectricalTest(uint8_t fuse_ok)
}
}

#ifdef MINI_VERSION
/*! \fn mooltipassMiniFunctionalTest(uint8_t current_bootkey_val, uint8_t flash_init_result, uint8_t touch_init_result, uint8_t fuse_ok)
* \brief Mooltipass standard functional test
* \param current_bootkey_val Current boot key value
Expand Down Expand Up @@ -298,6 +299,7 @@ void mooltipassMiniFunctionalTest(uint16_t current_bootkey_val, uint8_t flash_in
}
}
}
#endif

#ifdef HARDWARE_OLIVIER_V1
/*! \fn mooltipassStandardFunctionalTest(uint8_t current_bootkey_val, uint8_t flash_init_result, uint8_t touch_init_result, uint8_t fuse_ok)
Expand Down
2 changes: 2 additions & 0 deletions source_code/src/mini_inputs.h
Expand Up @@ -28,6 +28,7 @@
#define JOYSTICK_H_

/* DEFINES */
#ifdef MINI_VERSION
// Touch input returns
#define JOYSTICK_POS_RIGHT PORTID_JOY_RIGHT
#define JOYSTICK_POS_LEFT PORTID_JOY_LEFT
Expand All @@ -47,6 +48,7 @@
#define JOYSTICK_WC_MASK (JOYSTICK_UP_MASK | JOYSTICK_DOWN_MASK | JOYSTICK_LEFT_MASK | JOYSTICK_RIGHT_MASK)
#define JOYSTICK_MASK (JOYSTICK_UP_MASK | JOYSTICK_DOWN_MASK | JOYSTICK_LEFT_MASK | JOYSTICK_RIGHT_MASK | JOYSTICK_CENTER_MASK)
#define NO_MASK 0xFF
#endif

/* PROTOTYPES */
RET_TYPE isMiniDirectionPressed(uint8_t direction);
Expand Down
14 changes: 7 additions & 7 deletions source_code/src/mooltipass.c
Expand Up @@ -143,13 +143,6 @@ int main(void)
// Jump to bootloader
start_bootloader();
}

// Check if there was a change in the mooltipass setting storage to reset the parameters to their correct values
if (getMooltipassParameterInEeprom(USER_PARAM_INIT_KEY_PARAM) != USER_PARAM_CORRECT_INIT_KEY)
{
mooltipassParametersInit();
setMooltipassParameterInEeprom(USER_PARAM_INIT_KEY_PARAM, USER_PARAM_CORRECT_INIT_KEY);
}
#endif

/** EEPROM INITIALIZATIONS AT FIRST BOOT **/
Expand All @@ -160,6 +153,13 @@ int main(void)
// Set bootloader password bool to FALSE
eeprom_write_byte((uint8_t*)EEP_BOOT_PWD_SET, FALSE);
}

/** CHANGE IN MOOLTIPASS SETTINGS STORAGE */
if (getMooltipassParameterInEeprom(USER_PARAM_INIT_KEY_PARAM) != USER_PARAM_CORRECT_INIT_KEY)
{
mooltipassParametersInit();
setMooltipassParameterInEeprom(USER_PARAM_INIT_KEY_PARAM, USER_PARAM_CORRECT_INIT_KEY);
}

/** JUMPING TO BOOTLOADER FOR TEST UNITS **/
#ifdef AVR_BOOTLOADER_PROGRAMMING
Expand Down

0 comments on commit 6fec359

Please sign in to comment.