[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: VSDRIVE stand alone host (no pc) thread
On Tuesday, October 16, 2012 6:31:34 AM UTC-5, schmidtd wrote:
> On 10/16/2012 12:13 AM, Kevin wrote:
>
> > I figured out whats going on, AVRGCC is clipping everything to a int, thats fine for knowing what block to read, but when I multiply it by 512 to read that part of the file it tops out.
>
>
>
> Yep, that makes sense. The default item size is an int. You'll have to
>
> go crazy with casting as shorts or bytes.
well what was happening was I was multiplying two int's and expecting a unsigned long in return
unsigned long foo = (block * 512);
guess I got too used to fancypants compilers recently, and GCC was just not going to have any of that, so it boils down to I had to explicitly tell the compiler that 512 was a ul.
anywho that was the bug I was chasing, but banging my head against the desk for a week uncovered other issues, and simplification in my code. so while I may have just gotten it fully working, its hard as a tank and at like rev 5 before even releasing heh