ikalogic / ScanaStudio-scripts-v3

8 stars 13 forks source link

Fix UART #13

Closed hristomirchev closed 4 years ago

hristomirchev commented 4 years ago

When 9bit data is used it is not correct to make a byte at it's max value. So you separate it to two bytes. I fixed it to myself but it is annoying to fix mistakes! Also the sample point was with dots. Why? It is as easy to show logic "0" or "1" as to write dots.

On line near 420 there is a conditional "if (nbits > 0) value = 255;". This is not correct.

So there is my fix: if (nbits > 8) {
ScanaStudio.hex_view_add_byte(ch,start_edge,start_edge + (nbits samples_per_bit), (value >> 8) & 0xff); ScanaStudio.hex_view_add_byte(ch,start_edge,start_edge + (nbits samples_per_bit), (value & 0xff)); }

Also for the sample points ScanaStudio.dec_item_add_sample_point(start_edge + ((b + 0.5) * samples_per_bit), ((value >> b) & 0x1) ? 1 : 0);

ikalogic commented 4 years ago

Thanks and sorry for late reply.

I have taken your report into consideration. I have also added an option to choose the endianness of the hex view (see image below). image

Thank you very much for your contribution!

I'll close the issue, but please feel free to re-open if you feel more need to be done/fixed.

hristomirchev commented 4 years ago

Thank you!

На ср, 1.04.2020 г. в 21:55 IKALOGIC notifications@github.com написа:

Thanks and sorry for late reply.

I have taken your report into consideration. I have also added an option to choose the endianness of the hex view (see image below). [image: image] https://user-images.githubusercontent.com/2060712/78175047-8d04c480-745a-11ea-9988-ae446c9e3353.png

Thank you very much for your contribution!

I'll close the issue, but please feel free to re-open if you feel more need to be done/fixed.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ikalogic/ScanaStudio-scripts-v3/issues/13#issuecomment-607431309, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHZKDEPT574HMRK6HGVSUSDRKOE3VANCNFSM4LMIRWHA .