Skip to content
Snippets Groups Projects
Commit 5d8c7d37 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Corrected labcomm_pack32 to use current labcomm_writer interface.

parent 4975adc7
No related branches found
No related tags found
No related merge requests found
...@@ -346,11 +346,36 @@ static inline void labcomm_pack32(labcomm_writer_t *w, unsigned int data) ...@@ -346,11 +346,36 @@ static inline void labcomm_pack32(labcomm_writer_t *w, unsigned int data)
w->write(w, labcomm_writer_continue, n); w->write(w, labcomm_writer_continue, n);
} }
switch (n) { switch (n) {
case 5: w->data[w->pos++] = tag; tag = 0; case 5: {
case 4: w->data[w->pos++] = tmp[0] | tag; tag = 0; if (w->pos >= w->count) {
case 3: w->data[w->pos++] = tmp[1] | tag; tag = 0; w->write(w, labcomm_writer_continue);
case 2: w->data[w->pos++] = tmp[2] | tag; tag = 0; }
case 1: w->data[w->pos++] = tmp[3] | tag; w->data[w->pos++] = tag; tag = 0;
}
case 4: {
if (w->pos >= w->count) {
w->write(w, labcomm_writer_continue);
}
w->data[w->pos++] = tmp[0] | tag; tag = 0;
}
case 3: {
if (w->pos >= w->count) {
w->write(w, labcomm_writer_continue);
}
w->data[w->pos++] = tmp[1] | tag; tag = 0;
}
case 2: {
if (w->pos >= w->count) {
w->write(w, labcomm_writer_continue);
}
w->data[w->pos++] = tmp[2] | tag; tag = 0;
}
case 1: {
if (w->pos >= w->count) {
w->write(w, labcomm_writer_continue);
}
w->data[w->pos++] = tmp[3] | tag;
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment