Main Site Documentation

Reservepin call generates exception


#1

Hi,

I am trying to un-reserve some pins used by spi and i2c so that I may use them for gpio purposes.

I have enabled rlp and followed the procedure to unlock rlp too.

When I make the following call : Port.ReservePin((Cpu.Pin)FEZ_Pin.Digital.Di42,false);
I get the following exception :

Exception System.InvalidOperationException - CLR_E_INVALID_OPERATION (1)

#### Message: 
#### Microsoft.SPOT.Hardware.Port::ReservePin [IP: 0000] ####
#### serial_mux.Program::booting [IP: 0078] ####
#### serial_mux.Program::main_loop [IP: 0022] ####
#### serial_mux.Program::Main [IP: 001e] ####

A first chance exception of type ‘System.InvalidOperationException’ occurred in Microsoft.SPOT.Hardware.dll

Any suggested causes or remedies or corrections in my approach to solving the problem would be greatly appreciated !

Tom


#2

Dispose SPI and the pins will be automatically unreserved.


#3

Thanks !