1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

OP-277 Update all files to use a BOARD_TYPE and BOARD_REVISION scheme through the whole codebase.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2458 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
edouard 2011-01-16 20:41:55 +00:00 committed by edouard
parent ddaa306248
commit b3ca037308
16 changed files with 48 additions and 33 deletions

View File

@ -1063,7 +1063,7 @@ void firmwareiapobj_callback(AhrsObjHandle obj)
if(firmwareIAPObj.ArmReset==1)
{
if((firmwareIAPObj.Target==FUNC_ID) || (firmwareIAPObj.Target==0xFF))
if((firmwareIAPObj.BoardType==BOARD_TYPE) || (firmwareIAPObj.BoardType==0xFF))
{
++reset_count;
@ -1075,11 +1075,11 @@ void firmwareiapobj_callback(AhrsObjHandle obj)
}
}
}
else if(firmwareIAPObj.Target==FUNC_ID && firmwareIAPObj.crc!=iap_calc_crc())
else if(firmwareIAPObj.BoardType==BOARD_TYPE && firmwareIAPObj.crc!=iap_calc_crc())
{
read_description(firmwareIAPObj.Description);
firmwareIAPObj.crc=iap_calc_crc();
firmwareIAPObj.HWVersion=HW_VERSION;
firmwareIAPObj.BoardRevision=BOARD_REVISION;
FirmwareIAPObjSet(&firmwareIAPObj);
}
}

View File

@ -160,7 +160,7 @@ void process_spi_request(void) {
//PIOS_LED_On(LED1);
opahrs_msg_v0_init_user_tx(&user_tx_v0, OPAHRS_MSG_V0_RSP_VERSIONS);
user_tx_v0.payload.user.v.rsp.versions.bl_version = BOOTLOADER_VERSION;
user_tx_v0.payload.user.v.rsp.versions.hw_version = HW_VERSION;
user_tx_v0.payload.user.v.rsp.versions.hw_version = (BOARD_TYPE << 8) | BOARD_REVISION;
user_tx_v0.payload.user.v.rsp.versions.fw_crc = Fw_crc;
lfsm_user_set_tx_v0(&user_tx_v0);
break;

View File

@ -481,7 +481,7 @@ void OPDfuIni(uint8_t discover) {
dev.sizeOfDescription = SIZE_OF_DESCRIPTION;
dev.BL_Version = BOOTLOADER_VERSION;
dev.FW_Crc = CalcFirmCRC();
dev.devID = HW_VERSION;
dev.devID = (BOARD_TYPE << 8) | BOARD_REVISION;
dev.devType = HW_TYPE;
numberOfDevices = 1;
devicesTable[0] = dev;

View File

@ -422,7 +422,7 @@ void OPDfuIni(uint8_t discover) {
dev.sizeOfDescription = SIZE_OF_DESCRIPTION;
dev.BL_Version = BOOTLOADER_VERSION;
dev.FW_Crc = CalcFirmCRC();
dev.devID = HW_VERSION;
dev.devID = (BOARD_TYPE << 8) | BOARD_REVISION;
dev.devType = HW_TYPE;
numberOfDevices = 1;
devicesTable[0] = dev;

View File

@ -100,9 +100,9 @@ static void resetTask(void *parameters);
int32_t FirmwareIAPInitialize()
{
data.Target=FUNC_ID;
data.BoardType= BOARD_TYPE;
read_description(data.Description);
data.HWVersion=HW_VERSION;
data.BoardRevision= BOARD_REVISION;
data.ArmReset=0;
data.crc = 0;
FirmwareIAPObjSet( &data );
@ -131,10 +131,10 @@ static void FirmwareIAPCallback(UAVObjEvent* ev)
this_time = get_time();
delta = this_time - last_time;
last_time = this_time;
if((data.Target==FUNC_ID)&&(data.crc != iap_calc_crc()))
if((data.BoardType==BOARD_TYPE)&&(data.crc != iap_calc_crc()))
{
read_description(data.Description);
data.HWVersion=HW_VERSION;
data.BoardRevision=BOARD_REVISION;
data.crc = iap_calc_crc();
FirmwareIAPObjSet( &data );
}
@ -246,7 +246,7 @@ static void resetTask(void *parameters)
// Main task loop
lastSysTime = xTaskGetTickCount();
while (1) {
data.Target=0xFF;
data.BoardType=0xFF;
data.ArmReset=1;
data.crc=count;
FirmwareIAPObjSet(&data);

View File

@ -64,9 +64,14 @@ TIM8 | | | |
//------------------------
// BOOTLOADER_SETTINGS
//------------------------
#define FUNC_ID 2
#define HW_VERSION 69
//#define FUNC_ID 2
//#define HW_VERSION 69
#define BOOTLOADER_VERSION 0
#define BOARD_TYPE 0x02
#define BOARD_REVISION 0x01
//#define HW_VERSION (BOARD_TYPE << 8) | BOARD_REVISION
#define MEM_SIZE 0x20000 //128K
#define SIZE_OF_DESCRIPTION 100
#define START_OF_USER_CODE (uint32_t)0x08002000

View File

@ -60,9 +60,14 @@ TIM4 | RC In 1 | Servo 3 | Servo 2 | Servo 1
//------------------------
// BOOTLOADER_SETTINGS
//------------------------
#define FUNC_ID 2
#define HW_VERSION 69
//#define FUNC_ID 2
//#define HW_VERSION 69
#define BOOTLOADER_VERSION 0
#define BOARD_TYPE 0x04
#define BOARD_REVISION 0x01
//#define HW_VERSION (BOARD_TYPE << 8) | BOARD_REVISION
#define MEM_SIZE 0x20000 //128K
#define SIZE_OF_DESCRIPTION 100
#define START_OF_USER_CODE (uint32_t)0x08002000

View File

@ -62,9 +62,9 @@ TIM8 | | | |
//------------------------
// BOOTLOADER_SETTINGS
//------------------------
#define FUNC_ID 3
#define HW_VERSION 21
#define BOOTLOADER_VERSION 0
#define BOARD_TYPE 0x03
#define BOARD_REVISION 0x01
#define MEM_SIZE ((uint32_t)(*((volatile uint16_t *)(0x1FFFF7E0))) * 1024 - 1024) //128K
#define SIZE_OF_DESCRIPTION 100
#define START_OF_USER_CODE (uint32_t)0x08003000

View File

@ -69,9 +69,14 @@ TIM8 | Servo 5 | Servo 6 | Servo 7 | Servo 8
// BOOTLOADER_SETTINGS
//------------------------
#define FUNC_ID 1
#define HW_VERSION 01
//#define FUNC_ID 1
//#define HW_VERSION 01
#define BOOTLOADER_VERSION 0
#define BOARD_TYPE 0x01 // OpenPilot board
#define BOARD_REVISION 0x01 // Beta version
//#define HW_VERSION (BOARD_TYPE << 8) | BOARD_REVISION
#define MEM_SIZE 524288 //512K
#define SIZE_OF_DESCRIPTION (uint8_t) 100
#define START_OF_USER_CODE (uint32_t)0x08005000//REMEMBER SET ALSO IN link_stm32f10x_HD_BL.ld

View File

@ -88,17 +88,17 @@ void deviceWidget::populate()
devicePic->setSharedRenderer(new QSvgRenderer());
switch (id) {
case 1:
devicePic->renderer()->load(QString(":/uploader/images/deviceID-1.svg"));
case 0x0101:
devicePic->renderer()->load(QString(":/uploader/images/deviceID-0101.svg"));
break;
case 21:
devicePic->renderer()->load(QString(":/uploader/images/deviceID-21.svg"));
case 0x0301:
devicePic->renderer()->load(QString(":/uploader/images/deviceID-0301.svg"));
break;
case 42:
devicePic->renderer()->load(QString(":/uploader/images/deviceID-42.svg"));
case 0x0401:
devicePic->renderer()->load(QString(":/uploader/images/deviceID-0401.svg"));
break;
case 69:
devicePic->renderer()->load(QString(":/uploader/images/deviceID-69.svg"));
case 0x0201:
devicePic->renderer()->load(QString(":/uploader/images/deviceID-0201.svg"));
break;
default:
break;

View File

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 108 KiB

View File

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 122 KiB

View File

Before

Width:  |  Height:  |  Size: 239 KiB

After

Width:  |  Height:  |  Size: 239 KiB

View File

Before

Width:  |  Height:  |  Size: 552 KiB

After

Width:  |  Height:  |  Size: 552 KiB

View File

@ -1,13 +1,13 @@
<RCC>
<qresource prefix="/uploader">
<file>images/deviceID-1.svg</file>
<file>images/deviceID-69.svg</file>
<file>images/view-refresh.svg</file>
<file>images/system-run.svg</file>
<file>images/process-stop.svg</file>
<file>images/dialog-apply.svg</file>
<file>images/gtk-info.svg</file>
<file>images/deviceID-42.svg</file>
<file>images/deviceID-21.svg</file>
<file>images/deviceID-0401.svg</file>
<file>images/deviceID-0301.svg</file>
<file>images/deviceID-0201.svg</file>
<file>images/deviceID-0101.svg</file>
</qresource>
</RCC>

View File

@ -3,8 +3,8 @@
<description>Firmware IAP</description>
<field name="Command" units="" type="uint16" elements="1"/>
<field name="Description" units="" type="uint8" elements="100"/>
<field name="HWVersion" units="" type="uint16" elements="1"/>
<field name="Target" units="" type="uint8" elements="1"/>
<field name="BoardRevision" units="" type="uint16" elements="1"/>
<field name="BoardType" units="" type="uint8" elements="1"/>
<field name="ArmReset" units="" type="uint8" elements="1"/>
<field name="crc" units="" type="uint32" elements="1"/>
<access gcs="readwrite" flight="readwrite"/>