Skip to content

Commit

Permalink
дополнил описания, таймаут вынес в макрос
Browse files Browse the repository at this point in the history
  • Loading branch information
iamsaywhat committed Mar 17, 2020
1 parent f34c3d9 commit 6f3de25
Show file tree
Hide file tree
Showing 4 changed files with 169 additions and 153 deletions.
86 changes: 59 additions & 27 deletions BUP.uvoptx
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>95</LineNumber>
<LineNumber>36</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134255728</Address>
<Address>134259278</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
Expand All @@ -155,7 +155,39 @@
<BreakIfRCount>1</BreakIfRCount>
<Filename>.\main.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\BK_BRPU\main.c\95</Expression>
<Expression></Expression>
</Bp>
<Bp>
<Number>1</Number>
<Type>0</Type>
<LineNumber>341</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134251592</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>.\custom.drivers\radiostation.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
<Bp>
<Number>2</Number>
<Type>0</Type>
<LineNumber>56</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>.\main.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
</Breakpoint>
<WatchWindow1>
Expand All @@ -179,92 +211,92 @@
<WinNumber>1</WinNumber>
<ItemText>systemTime,0x10</ItemText>
</Ww>
<Ww>
<count>4</count>
<WinNumber>1</WinNumber>
<ItemText>sdsIdList</ItemText>
</Ww>
</WatchWindow1>
<WatchWindow2>
<Ww>
<count>0</count>
<WinNumber>2</WinNumber>
<ItemText>Log_Fs_Info</ItemText>
<ItemText>sdsIdList</ItemText>
</Ww>
<Ww>
<count>1</count>
<WinNumber>2</WinNumber>
<ItemText>Log_Fs_FileProperties</ItemText>
<ItemText>Log_Fs_Info</ItemText>
</Ww>
<Ww>
<count>2</count>
<WinNumber>2</WinNumber>
<ItemText>debug_vars</ItemText>
<ItemText>Log_Fs_FileProperties</ItemText>
</Ww>
<Ww>
<count>3</count>
<WinNumber>2</WinNumber>
<ItemText>BUP_DataStorage</ItemText>
<ItemText>debug_vars</ItemText>
</Ww>
<Ww>
<count>4</count>
<WinNumber>2</WinNumber>
<ItemText>rtU</ItemText>
<ItemText>BUP_DataStorage</ItemText>
</Ww>
<Ww>
<count>5</count>
<WinNumber>2</WinNumber>
<ItemText>rtDW</ItemText>
<ItemText>rtU</ItemText>
</Ww>
<Ww>
<count>6</count>
<WinNumber>2</WinNumber>
<ItemText>rtU</ItemText>
<ItemText>rtDW</ItemText>
</Ww>
<Ww>
<count>7</count>
<WinNumber>2</WinNumber>
<ItemText>rtDW</ItemText>
<ItemText>rtU</ItemText>
</Ww>
<Ww>
<count>8</count>
<WinNumber>2</WinNumber>
<ItemText>rtY</ItemText>
<ItemText>rtDW</ItemText>
</Ww>
<Ww>
<count>9</count>
<WinNumber>2</WinNumber>
<ItemText>systemState</ItemText>
<ItemText>rtY</ItemText>
</Ww>
<Ww>
<count>10</count>
<WinNumber>2</WinNumber>
<ItemText>systemTime</ItemText>
<ItemText>systemState</ItemText>
</Ww>
<Ww>
<count>11</count>
<WinNumber>2</WinNumber>
<ItemText>SNS_orientation</ItemText>
<ItemText>systemTime</ItemText>
</Ww>
<Ww>
<count>12</count>
<WinNumber>2</WinNumber>
<ItemText>SNS_position</ItemText>
<ItemText>SNS_orientation</ItemText>
</Ww>
<Ww>
<count>13</count>
<WinNumber>2</WinNumber>
<ItemText>buffer</ItemText>
<ItemText>SNS_position</ItemText>
</Ww>
<Ww>
<count>14</count>
<WinNumber>2</WinNumber>
<ItemText>sdsNum</ItemText>
<ItemText>buffer</ItemText>
</Ww>
<Ww>
<count>15</count>
<WinNumber>2</WinNumber>
<ItemText>sdsIdList</ItemText>
<ItemText>sdsCounter</ItemText>
</Ww>
<Ww>
<count>16</count>
<WinNumber>2</WinNumber>
<ItemText>sdsList</ItemText>
</Ww>
</WatchWindow2>
<MemoryWindow1>
Expand Down Expand Up @@ -762,7 +794,7 @@
<GroupNumber>6</GroupNumber>
<FileNumber>32</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
Expand All @@ -783,15 +815,15 @@

<Group>
<GroupName>::Device</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>1</RteFlg>
</Group>

<Group>
<GroupName>::Drivers</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>1</RteFlg>
Expand Down
44 changes: 13 additions & 31 deletions custom.drivers/include/radiostation.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,41 +21,23 @@
#define PACKET_SIZE_LIMIT 256
#define RADIO_ADDRESS 0x01

#define RADIO_SEND_PAUSE 20
#define RADIO_SEND_PAUSE 1
#define RADIO_REQUEST_DELAY 20
#define RADIO_TRANSACTION_TIMEOUT 150

typedef __packed struct{
uint8_t index;
uint8_t address;
uint16_t length;
uint16_t crc;
}RadioBaseFrame;

typedef __packed struct{
uint8_t type;
uint16_t length;
uint8_t* data;
}RadioDataFrame;

typedef union {
RadioBaseFrame Struct;
uint8_t Buffer[6];
}RadioBaseFrameType;

typedef union {
RadioDataFrame Struct;
uint8_t Buffer[7];
}RadioDataFrameType;

/*****************
Коды ошибок
******************/
typedef enum{
RADIO_WRONG_CRC,
RADIO_WRONG_INDEX,
RADIO_TIMEOUT,
RADIO_SUCCESS,
RADIO_FAILED,
RADIO_WRONG_ADDRESS,
RADIO_EXCESS_PACKET_SIZE,
RADIO_COORDINATES_NOT_FOUND,
RADIO_WRONG_CRC, // Ошибка в контрольной сумме
RADIO_WRONG_INDEX, // Индекс кадра запроса и ответа не совпали
RADIO_TIMEOUT, // Таймаут
RADIO_SUCCESS, // Без ошибок/Положительный результат
RADIO_FAILED, // Ошибка/Отрицательный результат
RADIO_WRONG_ADDRESS, // Адрес радиостанции не опознан
RADIO_EXCESS_PACKET_SIZE, // Превышен размер входящего пакета
RADIO_COORDINATES_NOT_FOUND, // В сообщении не найдены координаты
}RadioStatus;


Expand Down
Loading

0 comments on commit 6f3de25

Please sign in to comment.