I have necessity to reconfigure a SPI mosi port. This is a 1 bit buffered output port and i want to remove the "buffered" and make it simply "out port".
I have a single thread that first use the SPI (with module_spi_master), and after I not longer need the SPI and i want reconfigure the MOSI pin.
The SPI struct is defined in "master.h" as:
Code: Select all
typedef struct spi_master_interface
{
clock blk1;
clock blk2;
out buffered port:8 mosi;
out buffered port:8 sclk;
in buffered port:8 miso;
} spi_master_interface;
Code: Select all
on stdcore[0]: spi_master_interface spi_if =
{
XS1_CLKBLK_1,
XS1_CLKBLK_2,
PORT_SPI_MOSI,
PORT_SPI_CLK,
PORT_SPI_MISO
};
Code: Select all
int main(void) {
par {
on stdcore[1] : {
...
}
on stdcore[0] : {
...
}
on stdcore[0] : {
Use_SPI_Function(spi_if);
Reuse_Pin_Function(spi_if);
}
}
}
I want create movable pointers and i have add in Reuse_Pin_Function() this instruction:
Code: Select all
pDataValid = reconfigure_port(move(buf_mosi), out port);
The problem is the place where the movable pointer must be declared:
Code: Select all
buffered out port:8 * movable buf_mosi=&spi_if.mosi;
out port * movable pDataValid;
Code: Select all
on stdcore[0]:buffered out port:8 * movable buf_mosi=&spi_if.mosi;
on stdcore[0]:out port * movable pDataValid;
... error: a variable declaration prefixed with on must declare an object of type port or clock
Any suggestion?
Regards