Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Array_Matrix TS_DISCO_F746NG LCD_DISCO_F746NG BSP_DISCO_F746NG
Revision 18:506535948dc4, committed 2016-08-15
- Comitter:
- MikamiUitOpen
- Date:
- Mon Aug 15 02:39:55 2016 +0000
- Parent:
- 17:483926be0cf1
- Child:
- 19:ba5be6b8bc99
- Commit message:
- 19; Additionally registered class: ResetButton;
Changed in this revision
| ResetButton.hpp | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ResetButton.hpp Mon Aug 15 02:39:55 2016 +0000
@@ -0,0 +1,46 @@
+//-----------------------------------------------------------
+// ResetButton class -- derived class of Button class
+//
+// 2016/08/15, Copyright (c) 2016 MIKAMI, Naoki
+//-----------------------------------------------------------
+
+#ifndef F746_RESET_BUTTON_HPP
+#define F746_RESET_BUTTON_HPP
+
+#include "Button.hpp"
+
+namespace Mikami
+{
+ class ResetButton : public Button
+ {
+ public:
+ ResetButton(uint16_t x = 0, uint16_t y = 236,
+ uint16_t w = 36, uint16_t h = 36)
+ : Button(x, y, w, h)
+ {
+ pt_[0] = (Point){x+0.2f*w, y+h/2};
+ pt_[1] = (Point){x+0.75f*w, y+0.175f*h};
+ pt_[2] = (Point){x+0.75f*w, y+0.825f*h};
+ Draw();
+ }
+
+ void Do()
+ {
+ if (!Touched()) return;
+
+ wait(0.2f);
+ NVIC_SystemReset();
+ }
+
+ void Draw()
+ {
+ Activate();
+ lcd_.SetTextColor(LCD_COLOR_WHITE);
+ lcd_.FillPolygon(pt_, 3);
+ }
+
+ private:
+ Point pt_[3];
+ };
+}
+#endif // F746_RESET_BUTTON_HPP