Commit 7c1a8880 authored by Andrey Filippov's avatar Andrey Filippov

Fixed error in C-code generator

parent 964c6147
...@@ -1174,11 +1174,16 @@ class X393ExportC(object): ...@@ -1174,11 +1174,16 @@ class X393ExportC(object):
else: else:
return "" return ""
else: else:
if isinstance(address_inc,(list,tuple)): # var_name, var_range are also lists/tuples of the same length
address_inc = [4 * d for d in address_inc]
else:
address_inc = 4 * address_inc
if (mode == 'defines') : if (mode == 'defines') :
return self.expand_define(define_tuple = (name, return self.expand_define(define_tuple = (name,
var_name, var_name,
address * 4 + self.MAXI0_BASE, address * 4 + self.MAXI0_BASE,
address_inc * 4, address_inc, # * 4,
var_range, var_range,
data_type, data_type,
rw, rw,
...@@ -1188,7 +1193,7 @@ class X393ExportC(object): ...@@ -1188,7 +1193,7 @@ class X393ExportC(object):
return self.func_declare (define_tuple = (name, return self.func_declare (define_tuple = (name,
var_name, var_name,
address * 4 + self.MAXI0_BASE, address * 4 + self.MAXI0_BASE,
address_inc * 4, address_inc, # * 4,
var_range, var_range,
data_type, data_type,
rw, rw,
...@@ -1198,7 +1203,7 @@ class X393ExportC(object): ...@@ -1198,7 +1203,7 @@ class X393ExportC(object):
return self.func_define (define_tuple = (name, return self.func_define (define_tuple = (name,
var_name, var_name,
address * 4, # + self.MAXI0_BASE, address * 4, # + self.MAXI0_BASE,
address_inc * 4, address_inc, # * 4,
var_range, var_range,
data_type, data_type,
rw, rw,
......
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