forked from PAWPAW-Mirror/lib_xua
Fix issue of sending each byte of iAP as a word. Write each thing that comes in as an 8 bit value. Need new in line asm to do this.
This commit is contained in:
@@ -1257,8 +1257,8 @@ void decouple(chanend c_mix_out,
|
|||||||
/* There is room in the collecting buffer for the data */
|
/* There is room in the collecting buffer for the data */
|
||||||
xc_ptr p = (iap_to_host_buffer_being_collected + 4) + iap_data_collected_from_device;
|
xc_ptr p = (iap_to_host_buffer_being_collected + 4) + iap_data_collected_from_device;
|
||||||
// Add data to the buffer
|
// Add data to the buffer
|
||||||
write_via_xc_ptr(p, datum_iap);
|
write_byte_via_xc_ptr_indexed(p, 0, datum_iap);
|
||||||
iap_data_collected_from_device += 4;
|
iap_data_collected_from_device += 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ inline xc_ptr array_to_xc_ptr(unsigned a[]) {
|
|||||||
#define write_via_xc_ptr(p,x) asm("stw %0, %1[0]"::"r"(x),"r"(p))
|
#define write_via_xc_ptr(p,x) asm("stw %0, %1[0]"::"r"(x),"r"(p))
|
||||||
|
|
||||||
#define write_via_xc_ptr_indexed(p,i,x) asm("stw %0, %1[%2]"::"r"(x),"r"(p),"r"(i))
|
#define write_via_xc_ptr_indexed(p,i,x) asm("stw %0, %1[%2]"::"r"(x),"r"(p),"r"(i))
|
||||||
|
#define write_byte_via_xc_ptr_indexed(p,i,x) asm("st8 %0, %1[%2]"::"r"(x),"r"(p),"r"(i))
|
||||||
|
|
||||||
#define read_via_xc_ptr(x,p) asm("ldw %0, %1[0]":"=r"(x):"r"(p));
|
#define read_via_xc_ptr(x,p) asm("ldw %0, %1[0]":"=r"(x):"r"(p));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user