title: How to know if the ESP8266 has been manually reset?
body: <p>I have a code looping with the help of the <code>dsleep</code> mode. Each time <code>dsleep</code> ends, the <code>init.lua</code> is loaded, does something the goes back to sleep.</p>
  
  <p>Now I want to implement a button to my ESP8266 that will trigger the reset pin. When pushed, my system should enter in a "setup mode", providing AP to do some setup (that part of code is OK).</p>
  
  <p>My problem is: <em>How do I know if the current init was triggered manually (then go to setup mode) or by normal reboot after <code>dsleep</code>?</em></p>
  
  <p>I'm guessing that there should be two ways doing this:</p>
  
  <ol>
  <li><strong>programmatically</strong>: somehow store a meta-global variable changed by the gpio15 trigger in the end of <code>dsleep</code> ...</li>
  <li><strong>electronically</strong>: hack something to change one pin state when pushing reset button</li>
  </ol>
  
  <p>Any advice?</p>