what pinmode is D0 and D1 default?

It sounds a bit like a stupid question but let me explain the background.

Normally I do not set any pinmode like

pinMode(0, INPUT);

for the both pins 0 (RX receiver, means input) and 1 (TX transmitter means output).

I'm using a GPRSBee on the hardware serial (pin 0 and 1) of the Seeeduino Stalker (Arduino Pro Mini compatible) with this lib GitHub - SodaqMoja/GPRSbee: Arduino library for GPRSbee . So I don't know if there is some pinMode set by the lib. With a quick search I did not find an explicitly set pinmode.

With the new Stalker board version 3.1, there is an advice to save power with

pinMode(0, INPUT);
pinMode(1, INPUT);

right before going deep sleeping.

Please set D0,D1 as input before going into sleep mode

So my question is now: Do I have to "switch back" right after wake up? and what do I have to set? Is this correct?

pinMode(0, INPUT);
pinMode(1, OUTPUT);

I did some test without this last step/code and the GPRSbee is still working. But it seems to be a bit slower than before. What is the "clean" way here?

This is a difficult question to answer, because the UART hardware will normally override your efforts to set the pin state and function of D0 and D1.

To determine what happens in sleep mode would require close study of the data sheet (if the answer could even be found there). Try posting on the AVRFreaks forum -- company experts there might know.

Also, the advice may not be good advice.

Ok, thanks! This is a good information that it seems my settings (before sleeping) will not continue and be valid forever. Btw the difference between normal deep sleep and setting D0 and D1 as input is in the new version of the Stalker 0.13 mA vs. 0.04 mA. This is an effect of additional parts attached to D0 and D1 on this board.