Commit 3590e175 authored by Matthieu Cattin's avatar Matthieu Cattin

fmc_adc_spec: Add a test and exception for zero length data retreive.

parent 67075ccc
......@@ -397,6 +397,8 @@ class CFmcAdc100mSpec:
# carrier_addr and length are in bytes
def get_data(self, carrier_addr, length):
# Configure DMA
if length == 0:
raise Exception('Cannot retreive data of zero length!')
items_required = int(math.ceil(length/float(self.DMA_LENGTH)))
if(128 < items_required):
print('Required items: %d')%items_required
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment