File tree Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,8 @@ typedef struct __attribute__((__packed__))
157
157
chip_id_t nand_id ;
158
158
} np_resp_id_t ;
159
159
160
+ /* BB, write ack and error responses are aligned to the same size to avoid
161
+ * receiver wait for additional data */
160
162
typedef struct __attribute__((__packed__ ))
161
163
{
162
164
np_resp_t header ;
@@ -168,12 +170,14 @@ typedef struct __attribute__((__packed__))
168
170
{
169
171
np_resp_t header ;
170
172
uint64_t bytes_ack ;
173
+ uint8_t dummy [4 ];
171
174
} np_resp_write_ack_t ;
172
175
173
176
typedef struct __attribute__((__packed__ ))
174
177
{
175
178
np_resp_t header ;
176
179
uint8_t err_code ;
180
+ uint8_t dummy [11 ];
177
181
} np_resp_err_t ;
178
182
179
183
typedef struct __attribute__((__packed__ ))
Original file line number Diff line number Diff line change @@ -133,6 +133,8 @@ typedef struct __attribute__((__packed__))
133
133
ChipId nandId;
134
134
} RespId;
135
135
136
+ /* BB, write ack and error responses are aligned to the same size to avoid
137
+ * receiver wait for additional data */
136
138
typedef struct __attribute__ ((__packed__))
137
139
{
138
140
RespHeader header;
@@ -144,12 +146,14 @@ typedef struct __attribute__((__packed__))
144
146
{
145
147
RespHeader header;
146
148
uint64_t ackBytes;
149
+ uint8_t dummy[4 ];
147
150
} RespWriteAck;
148
151
149
152
typedef struct __attribute__ ((__packed__))
150
153
{
151
154
RespHeader header;
152
155
uint8_t errCode;
156
+ uint8_t dummy[11 ];
153
157
} RespError;
154
158
155
159
typedef struct __attribute__ ((__packed__))
Original file line number Diff line number Diff line change @@ -301,7 +301,7 @@ int Writer::writeData()
301
301
break ;
302
302
}
303
303
304
- if (read (pbuf, writeDataAckLen ))
304
+ if (read (pbuf, sizeof (RespWriteAck) ))
305
305
return -1 ;
306
306
307
307
return 0 ;
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ class Writer : public QObject
16
16
Q_OBJECT
17
17
18
18
static const uint32_t bufSize = 64 ;
19
- static const uint32_t writeDataAckLen = 10 ;
20
19
21
20
SerialPort *serialPort = nullptr ;
22
21
QString portName;
You can’t perform that action at this time.
0 commit comments