Using 64 bit math is just way easier to read and
just as safe and precise.
Also cleanup random bits in that area
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
When you have something like:
if (bad_thing_happenned)
lms_printf("Panic !");
defining lms_printf to nothing creates a warning.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
There was two issues :
- Swap between the RX/TX GPIOs controlling the switch
- The proper LNA was not being selected inside the LMS
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
The formula used is a very crude quadratic approximation from the
3 data points given in the programming manual ... for something more
precise, we'd need a LUT. But it may vary with temp and device anyway.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Currently the sample rate is not read back from the si5338 and
reconstructed. For the time being, this value is cached in the the
device structure. However, this is a crappy workaround because this
value obviously won't persist, for example, upon
opening/closing/re-opening the CLI.
An incorrect size in for GPIO read/write resulted in memory corruption.
Added and fixed timeouts to ensure control returns to caller if the FX3
fails to respond.
The copy previously was dereferencing symlinks, resulting in
copies of the library being installed. Asides from being terribly
undesirable, this also resulted in ldconfig warnings.
This fixes and issues where the drive would continue to submit URBs even after
the device was unplugged, and the usb_device was freed from the usb core causing
kernel panics.
The VCTCXO DAC operations now have the same functionality as GPIO reads/writes.
The Nios core stores the least significant byte in a temporary variable and only
performs a write to the DAC when the most sigificant byte of the 16bit DAC value
is written to it by the host.
This commit does not address host endianness.
GPIO reads and writes can now 8 bits of the 32bit nios_gpio (GPIO register)
register at a time by subscripting into the register with the uart_cmd.addr
variable. addr 0 operates on the least significant byte, addr 1 operates on the
second least significant byte.
GNU Radio appears to utilize some RT signals, which was causing
bladerf_read_c16 to fail out. These calls now retry so long
as the only error encountered is EINTR.
A last_errno field has been added to struct bladerf to assist
in debugging. We may want to either remove this or make it
(and its accesses/updates) conditionally compiled.
The value of x was being returned as 0 when the FPGA was either not
loaded or when the LMS was still in reset. Catch this condition and
return back an invalid parameter.
Another pass or two will definitely be required. So far, cleanup
includes:
- Adding checks of libbladeRF return codes
- Unifying the way errors are printed
- Reorganizing command order (as they're searched linearly), by
what's most time-sensitive.
- Removed "specialized help" stubs. These can be re-added if/when
this functionality is added
- Removed some noisy warnings and replaced some with errors.
- Script execution stops at first error encountered in script
Added:
- "clear" command to clear terminal
Remaining issues:
- We're still lacking a "run" command
- Valgrind indicates we have some remaining issues in cli_err()
that we should address.
Added support to run scripts from the command line. A 'run' command
still needs to be added. This will required a script stack and
detection of recursive loops.