Commit 19088f88 authored by Guilherme Sanches's avatar Guilherme Sanches

Update on the configure tool

The configure tool is now generating all iop .c files without errors.
parent e164feaf
......@@ -320,7 +320,7 @@ def sch_spwrtr(iop_parser, xml, pdevice):
# @param iop_parser IOP parser object
# @param xml XML setup node
# @param pdevice current physical device
def phy_occan(iop_parser, xml, pdevices):
def phy_occan(iop_parser, xml, pdevice):
# clear previous errors and warnings
iop_parser.logger.clear_errors(0)
......@@ -337,7 +337,8 @@ def phy_occan(iop_parser, xml, pdevices):
# sanity check
if iop_parser.logger.check_errors(): return False
pdevices.setup = setup
pdevice.setup = setup
print(pdevice)
return True
## CANBUS schedule device setup
......
......@@ -27,7 +27,9 @@ ${EthHeader(route.header)}${',' if i < len(pdevice.routes) - 1 else ''}
${SpwHeader(route.header)}${',' if i < len(pdevice.routes) - 1 else ''}
% endfor
%elif pdevice.type =='CAN':
% for i, route in enumerate(pdevice.routes):
${CanHeader(route.header)}${',' if i < len(pdevice.routes) -1 else ''}
% endfor
% endif
};
......
......@@ -11,7 +11,7 @@
#include <can_support.h>
#include <iop_error.h>
void can_write(iop_physical_device_t *pdev)
void can_writer(iop_physical_device_t *pdev)
{
/* Initialize error chain (packets to be re-sent) */
......
......@@ -45,7 +45,7 @@ uint16_t can_compare_header(
void can_prebuild_header(
can_header_t *header);
void can_write(iop_physical_device_t *pdev);
void can_writer(iop_physical_device_t *pdev);
void can_reader(iop_physical_device_t *pdev);
#endif
......@@ -2,13 +2,13 @@
# device functions
device_functions = dict(
reader_task='can_reader',
write_task='can_write',
writer_task='can_writer',
header_prebuild='can_prebuild_header',
header_compare='can_compare_header',
header_copy='can_copy_header')
%>\
<%namespace name="iop_template" file="/iop_template.mako"/>\
<%namespace name="iop_template" file="/iop_templates.mako"/>\
/*
* ============================================================================
* This file was generated by the GMV's Configurator Tool and is part of an I/O
......@@ -53,13 +53,13 @@ static uint8_t descriptor_table[3072];
/** @brief OCCAN control structure*/
static occan_priv occan_driver = ${'\\'}
{
.speed = ${device.setup.speed},
.speed = ${device.setup.speed}000,
.filter = {
.single_mode = ${1 \
if device.setup.single_mode is True else \
0},
.code = {${device.setup.code}},
.mask = {${device.setup.mask}},
.code = {${','.join('0x' + s for s in device.setup.code)}},
.mask = {${','.join('0x' + s for s in device.setup.mask)}},
},
.iop_buffers = iop_buffers,
......@@ -88,7 +88,7 @@ static iop_can_device_t device_configuration = ${'\\'}
.write = occan_write,
.close = occan_close,
},
.dev_name = "/dev/${device.alias}",
.dev_name = "/dev/${device.device}",
};
${iop_template.PhysicalDevice(iop_configuration, device, device_functions)}\
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