Period-one (P1) oscillation is a manifestation of nonlinear dynamics in semiconductor lasers. The P1 dynamics of optically injected semiconductor lasers allows for photonic microwave generation that is widely tunable and optically controllable. The frequency stability can be improved through various feedback and locking techniques. Recently, the switching between the stable and P1 nonlinear dynamical states of a semiconductor laser is experimented for squarewave modulated photonic microwave generation. The stable state corresponds to a single-frequency continuous-wave emission, while the P1 state corresponds to emission at an optical carrier with sidebands separated by a microwave frequency of oscillation. The oscillation frequency is typically on the order of 10 GHz in correspondence to the relaxation resonance frequency of the laser, where extension to 100 GHz is possible through optical injection. Due to the nonlinear dynamics, regular switching between the states is yielded spontaneously with a period determined by the feedback round-trip time. Numerically, based on the Lang-Kobayashi model, the laser is investigated in the long-cavity regime in which the feedback delay time is sufficiently longer than the reciprocal of the relaxation resonance frequency of the laser. A large number of external cavity modes are supported even under a weak feedback strength. The state switching is thereby explained by sequential visits of the external cavity modes in a deterministic manner. The approach using P1 oscillation offers an alternative of microwave generation without involving any microwave electronics for modulation.