PIO Outputs disabled

I’m using a TWI Temp Sensor with with manual SCL and SDA generating for a AT91SAM7S controller. All the stuff works for the IAR project but with FreeRTOS (and gcc) it does not work right. SCL and SDA are sometimes generated, sometimes not. Somehow the PIO is set for input although there isn’t a configuration as input despite switching the SDA from output to input. Of course I’d like to use the integrated TWI but the pin is already multiplexed for another peripheral.