流程图千变万化,搞循环没什么意思

代码: 全选
\begin{tikzpicture}[
auto,
Point/.style={fill=black,thick}]
% We need layers to draw the block diagram
\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}
% Define block styles
\tikzstyle{block} = [rectangle, draw, node distance=3cm, text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex']
% Place nodes
\node at (0,0) [block] (timer) {Timer0\_ISR};
\node [block, below of = timer] (fkt) {Funktion};
\draw[Point] (4.5,-0.5) circle(2pt);
\node at (4.5,-3) [rectangle, draw, text width=7.5em, text centered, rounded corners, minimum height=4em] (button) {Push\_Button\_ISR};
% Draw edges
\path [line] (timer) -- (fkt);
\path [line] (button.south) |- (0,-4.5);
\path [line] (4.5,-0.5) -- node {SW4} (button);
% background
\begin{pgfonlayer}{background}
%Place nodes
\draw[Point] (0,5) circle(2pt);
\node at (0,2.5) [block] (init) {Init};
\node at (0,-1.5)[rectangle, draw, node distance=3cm, rounded corners,
minimum height=4.8cm, minimum width=4.5cm] (main) {};
\node at (0,-6) [diamond, draw] (while) {While(1)};
\node at (1.85,-1.5) [rectangle, draw, dashed, rounded corners, minimum height=5.3cm, minimum width=8.8cm](whole) {};
\node at (1.8,0.5) [circle, draw] (H) {\small H};
% Draw edges
\path [line] (0,5) -- (init);
\path [line] (init) -- (main);
\path [line] (main) -- (while);
\path [line] (while.west) -| ++(-3cm,0) |- (0,1.3);
\end{pgfonlayer}
\end{tikzpicture}