├── LICENSE ├── README.md ├── 上位机 ├── WindowsApp1.sln └── WindowsApp1 │ ├── App.config │ ├── Form1.Designer.vb │ ├── Form1.resx │ ├── Form1.vb │ ├── My Project │ ├── Application.Designer.vb │ ├── Application.myapp │ ├── AssemblyInfo.vb │ ├── Resources.Designer.vb │ ├── Resources.resx │ ├── Settings.Designer.vb │ └── Settings.settings │ ├── WindowsApp1.vbproj │ ├── WindowsApp1.vbproj.user │ ├── WindowsApp1_TemporaryKey.pfx │ ├── bin │ ├── Debug │ │ ├── WindowsApp1.exe │ │ ├── WindowsApp1.exe.config │ │ ├── WindowsApp1.pdb │ │ └── WindowsApp1.xml │ └── Release │ │ ├── WindowsApp1.exe │ │ ├── WindowsApp1.exe.config │ │ ├── WindowsApp1.pdb │ │ └── WindowsApp1.xml │ └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferences.cache │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TempPE │ └── My Project.Resources.Designer.vb.dll │ ├── WindowsApp1.Form1.resources │ ├── WindowsApp1.Resources.resources │ ├── WindowsApp1.exe │ ├── WindowsApp1.pdb │ ├── WindowsApp1.vbproj.CoreCompileInputs.cache │ ├── WindowsApp1.vbproj.FileListAbsolute.txt │ ├── WindowsApp1.vbproj.GenerateResource.cache │ ├── WindowsApp1.vbprojAssemblyReference.cache │ └── WindowsApp1.xml ├── 中文字库 ├── 16X16.FON └── README.MD ├── 源代码 ├── Graph.c ├── Graph.h ├── Listings │ ├── Conf_tny.lst │ ├── Graph.lst │ ├── STARTUP.lst │ ├── Terminal.lst │ ├── adc.lst │ ├── alarm.lst │ ├── eeprom.lst │ ├── ext_iic.lst │ ├── flash.lst │ ├── internal_iic.lst │ ├── main.lst │ ├── menu.lst │ ├── menu_img.lst │ ├── morse.lst │ ├── mpu6050.lst │ ├── music.lst │ ├── oled.lst │ ├── rtc.lst │ ├── serial.lst │ ├── settings.lst │ └── watch.m51 ├── Objects │ ├── Conf_tny.obj │ ├── ExtDll.iex │ ├── Graph.obj │ ├── STARTUP.obj │ ├── Terminal.obj │ ├── adc.obj │ ├── alarm.obj │ ├── eeprom.obj │ ├── ext_iic.obj │ ├── flash.obj │ ├── internal_iic.obj │ ├── main.obj │ ├── menu.obj │ ├── morse.obj │ ├── mpu6050.obj │ ├── music.obj │ ├── oled.obj │ ├── rtc.obj │ ├── serial.obj │ ├── settings.obj │ ├── watch │ ├── watch.ORC │ ├── watch.build_log.htm │ ├── watch.hex │ └── watch.lnp ├── STARTUP.A51 ├── Terminal.c ├── Terminal.h ├── adc.c ├── adc.h ├── alarm.c ├── alarm.h ├── config.h ├── flash.c ├── flash.h ├── internal_iic.c ├── internal_iic.h ├── main.c ├── menu.c ├── menu.h ├── morse.c ├── morse.h ├── music.c ├── music.h ├── oled.c ├── oled.h ├── rtc.c ├── rtc.h ├── serial.c ├── serial.h ├── settings.c ├── settings.h ├── watch.uvgui.14522 ├── watch.uvopt └── watch.uvproj └── 简单的外壳_3D模型 ├── 3D.skb ├── 3D.skp ├── 3D.stl ├── bottom.stl └── top.stl /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published 637 | by the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MyWatch 2 | DIY手表,基于STC8A8K64S4A12 3 | 4 | 演示:https://www.bilibili.com/video/BV1Xy4y1H7GB 5 | 6 | 立创EDA开源地址:https://oshwhub.com/lxu0423/stc_watch_copy 7 | 8 | OLED快速绘图算法来自:https://github.com/zkemble/NWatch/ 9 | 10 | 因为上面那个项目用了GPL,需不需要继承不清楚,保险起见,我也用个GPL 11 | 12 | 支持自动复位,如果已烧录好固件并正常运行,串口更新时请选择最低波特率9600,否则无法自动复位 13 | 14 | 如果死机或串口自动烧录无法触发,可长按确认键5秒强制复位(前提是已烧录固件) 15 | -------------------------------------------------------------------------------- /上位机/WindowsApp1.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.1321 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WindowsApp1", "WindowsApp1\WindowsApp1.vbproj", "{0B7A6F45-7A51-4B63-A8BD-76EF602F86F1}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {0B7A6F45-7A51-4B63-A8BD-76EF602F86F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {0B7A6F45-7A51-4B63-A8BD-76EF602F86F1}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {0B7A6F45-7A51-4B63-A8BD-76EF602F86F1}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {0B7A6F45-7A51-4B63-A8BD-76EF602F86F1}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {64B39511-B565-4FD5-AF3B-A5A0BACEEC49} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /上位机/WindowsApp1/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /上位机/WindowsApp1/Form1.Designer.vb: -------------------------------------------------------------------------------- 1 |  2 | Partial Class Form1 3 | Inherits System.Windows.Forms.Form 4 | 5 | 'Form 重写 Dispose,以清理组件列表。 6 | 7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean) 8 | Try 9 | If disposing AndAlso components IsNot Nothing Then 10 | components.Dispose() 11 | End If 12 | Finally 13 | MyBase.Dispose(disposing) 14 | End Try 15 | End Sub 16 | 17 | 'Windows 窗体设计器所必需的 18 | Private components As System.ComponentModel.IContainer 19 | 20 | '注意: 以下过程是 Windows 窗体设计器所必需的 21 | '可以使用 Windows 窗体设计器修改它。 22 | '不要使用代码编辑器修改它。 23 | 24 | Private Sub InitializeComponent() 25 | Me.components = New System.ComponentModel.Container() 26 | Me.SerialPort1 = New System.IO.Ports.SerialPort(Me.components) 27 | Me.Button1 = New System.Windows.Forms.Button() 28 | Me.ListBox1 = New System.Windows.Forms.ListBox() 29 | Me.ComboBox2 = New System.Windows.Forms.ComboBox() 30 | Me.Label2 = New System.Windows.Forms.Label() 31 | Me.Label3 = New System.Windows.Forms.Label() 32 | Me.Label4 = New System.Windows.Forms.Label() 33 | Me.Button2 = New System.Windows.Forms.Button() 34 | Me.Button3 = New System.Windows.Forms.Button() 35 | Me.ComboBox3 = New System.Windows.Forms.ComboBox() 36 | Me.Label5 = New System.Windows.Forms.Label() 37 | Me.Label6 = New System.Windows.Forms.Label() 38 | Me.Button4 = New System.Windows.Forms.Button() 39 | Me.TextBox2 = New System.Windows.Forms.TextBox() 40 | Me.TextBox3 = New System.Windows.Forms.TextBox() 41 | Me.TextBox4 = New System.Windows.Forms.TextBox() 42 | Me.TextBox6 = New System.Windows.Forms.TextBox() 43 | Me.ComboBox1 = New System.Windows.Forms.ComboBox() 44 | Me.Button5 = New System.Windows.Forms.Button() 45 | Me.Button6 = New System.Windows.Forms.Button() 46 | Me.Button7 = New System.Windows.Forms.Button() 47 | Me.Label7 = New System.Windows.Forms.Label() 48 | Me.CheckBox1 = New System.Windows.Forms.CheckBox() 49 | Me.TextBox5 = New System.Windows.Forms.TextBox() 50 | Me.Label8 = New System.Windows.Forms.Label() 51 | Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components) 52 | Me.Label9 = New System.Windows.Forms.Label() 53 | Me.Label10 = New System.Windows.Forms.Label() 54 | Me.StatusStrip1 = New System.Windows.Forms.StatusStrip() 55 | Me.ToolStripStatusLabel1 = New System.Windows.Forms.ToolStripStatusLabel() 56 | Me.ProgressBar1 = New System.Windows.Forms.ToolStripProgressBar() 57 | Me.Button8 = New System.Windows.Forms.Button() 58 | Me.StatusStrip1.SuspendLayout() 59 | Me.SuspendLayout() 60 | ' 61 | 'SerialPort1 62 | ' 63 | Me.SerialPort1.ReadBufferSize = 40960 64 | Me.SerialPort1.ReadTimeout = 2000 65 | Me.SerialPort1.WriteBufferSize = 20480 66 | ' 67 | 'Button1 68 | ' 69 | Me.Button1.Location = New System.Drawing.Point(30, 11) 70 | Me.Button1.Margin = New System.Windows.Forms.Padding(2) 71 | Me.Button1.Name = "Button1" 72 | Me.Button1.Size = New System.Drawing.Size(74, 20) 73 | Me.Button1.TabIndex = 1 74 | Me.Button1.Text = "自动连接" 75 | Me.Button1.UseVisualStyleBackColor = True 76 | ' 77 | 'ListBox1 78 | ' 79 | Me.ListBox1.FormattingEnabled = True 80 | Me.ListBox1.ItemHeight = 12 81 | Me.ListBox1.Location = New System.Drawing.Point(30, 34) 82 | Me.ListBox1.Margin = New System.Windows.Forms.Padding(2) 83 | Me.ListBox1.Name = "ListBox1" 84 | Me.ListBox1.Size = New System.Drawing.Size(175, 244) 85 | Me.ListBox1.TabIndex = 3 86 | ' 87 | 'ComboBox2 88 | ' 89 | Me.ComboBox2.FormattingEnabled = True 90 | Me.ComboBox2.Location = New System.Drawing.Point(356, 65) 91 | Me.ComboBox2.Margin = New System.Windows.Forms.Padding(2) 92 | Me.ComboBox2.Name = "ComboBox2" 93 | Me.ComboBox2.Size = New System.Drawing.Size(152, 20) 94 | Me.ComboBox2.TabIndex = 5 95 | ' 96 | 'Label2 97 | ' 98 | Me.Label2.AutoSize = True 99 | Me.Label2.Location = New System.Drawing.Point(324, 44) 100 | Me.Label2.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) 101 | Me.Label2.Name = "Label2" 102 | Me.Label2.Size = New System.Drawing.Size(29, 12) 103 | Me.Label2.TabIndex = 6 104 | Me.Label2.Text = "星期" 105 | ' 106 | 'Label3 107 | ' 108 | Me.Label3.AutoSize = True 109 | Me.Label3.Location = New System.Drawing.Point(324, 67) 110 | Me.Label3.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) 111 | Me.Label3.Name = "Label3" 112 | Me.Label3.Size = New System.Drawing.Size(29, 12) 113 | Me.Label3.TabIndex = 7 114 | Me.Label3.Text = "课程" 115 | ' 116 | 'Label4 117 | ' 118 | Me.Label4.AutoSize = True 119 | Me.Label4.Location = New System.Drawing.Point(303, 91) 120 | Me.Label4.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) 121 | Me.Label4.Name = "Label4" 122 | Me.Label4.Size = New System.Drawing.Size(53, 12) 123 | Me.Label4.TabIndex = 9 124 | Me.Label4.Text = "上课时间" 125 | ' 126 | 'Button2 127 | ' 128 | Me.Button2.Enabled = False 129 | Me.Button2.Location = New System.Drawing.Point(30, 290) 130 | Me.Button2.Margin = New System.Windows.Forms.Padding(2) 131 | Me.Button2.Name = "Button2" 132 | Me.Button2.Size = New System.Drawing.Size(74, 35) 133 | Me.Button2.TabIndex = 10 134 | Me.Button2.Text = "读取" 135 | Me.Button2.UseVisualStyleBackColor = True 136 | ' 137 | 'Button3 138 | ' 139 | Me.Button3.Enabled = False 140 | Me.Button3.Location = New System.Drawing.Point(130, 290) 141 | Me.Button3.Margin = New System.Windows.Forms.Padding(2) 142 | Me.Button3.Name = "Button3" 143 | Me.Button3.Size = New System.Drawing.Size(74, 35) 144 | Me.Button3.TabIndex = 11 145 | Me.Button3.Text = "保存" 146 | Me.Button3.UseVisualStyleBackColor = True 147 | ' 148 | 'ComboBox3 149 | ' 150 | Me.ComboBox3.FormattingEnabled = True 151 | Me.ComboBox3.Items.AddRange(New Object() {"响一声", "倒计时", "静音"}) 152 | Me.ComboBox3.Location = New System.Drawing.Point(356, 114) 153 | Me.ComboBox3.Margin = New System.Windows.Forms.Padding(2) 154 | Me.ComboBox3.Name = "ComboBox3" 155 | Me.ComboBox3.Size = New System.Drawing.Size(152, 20) 156 | Me.ComboBox3.TabIndex = 12 157 | ' 158 | 'Label5 159 | ' 160 | Me.Label5.AutoSize = True 161 | Me.Label5.Location = New System.Drawing.Point(303, 116) 162 | Me.Label5.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) 163 | Me.Label5.Name = "Label5" 164 | Me.Label5.Size = New System.Drawing.Size(53, 12) 165 | Me.Label5.TabIndex = 14 166 | Me.Label5.Text = "设置提醒" 167 | ' 168 | 'Label6 169 | ' 170 | Me.Label6.AutoSize = True 171 | Me.Label6.Location = New System.Drawing.Point(302, 139) 172 | Me.Label6.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) 173 | Me.Label6.Name = "Label6" 174 | Me.Label6.Size = New System.Drawing.Size(53, 12) 175 | Me.Label6.TabIndex = 15 176 | Me.Label6.Text = "提前提醒" 177 | ' 178 | 'Button4 179 | ' 180 | Me.Button4.Enabled = False 181 | Me.Button4.Location = New System.Drawing.Point(356, 160) 182 | Me.Button4.Margin = New System.Windows.Forms.Padding(2) 183 | Me.Button4.Name = "Button4" 184 | Me.Button4.Size = New System.Drawing.Size(152, 29) 185 | Me.Button4.TabIndex = 16 186 | Me.Button4.Text = "存入列表" 187 | Me.Button4.UseVisualStyleBackColor = True 188 | ' 189 | 'TextBox2 190 | ' 191 | Me.TextBox2.Location = New System.Drawing.Point(358, 89) 192 | Me.TextBox2.Margin = New System.Windows.Forms.Padding(2) 193 | Me.TextBox2.Name = "TextBox2" 194 | Me.TextBox2.Size = New System.Drawing.Size(21, 21) 195 | Me.TextBox2.TabIndex = 17 196 | Me.TextBox2.Text = "7" 197 | ' 198 | 'TextBox3 199 | ' 200 | Me.TextBox3.Location = New System.Drawing.Point(394, 89) 201 | Me.TextBox3.Margin = New System.Windows.Forms.Padding(2) 202 | Me.TextBox3.Name = "TextBox3" 203 | Me.TextBox3.Size = New System.Drawing.Size(20, 21) 204 | Me.TextBox3.TabIndex = 17 205 | Me.TextBox3.Text = "0" 206 | ' 207 | 'TextBox4 208 | ' 209 | Me.TextBox4.Location = New System.Drawing.Point(475, 88) 210 | Me.TextBox4.Margin = New System.Windows.Forms.Padding(2) 211 | Me.TextBox4.Name = "TextBox4" 212 | Me.TextBox4.Size = New System.Drawing.Size(34, 21) 213 | Me.TextBox4.TabIndex = 17 214 | Me.TextBox4.Text = "40" 215 | ' 216 | 'TextBox6 217 | ' 218 | Me.TextBox6.Location = New System.Drawing.Point(356, 137) 219 | Me.TextBox6.Margin = New System.Windows.Forms.Padding(2) 220 | Me.TextBox6.Name = "TextBox6" 221 | Me.TextBox6.Size = New System.Drawing.Size(152, 21) 222 | Me.TextBox6.TabIndex = 18 223 | Me.TextBox6.Text = "0" 224 | ' 225 | 'ComboBox1 226 | ' 227 | Me.ComboBox1.FormattingEnabled = True 228 | Me.ComboBox1.Items.AddRange(New Object() {"一", "二", "三", "四", "五", "六", "日"}) 229 | Me.ComboBox1.Location = New System.Drawing.Point(356, 42) 230 | Me.ComboBox1.Margin = New System.Windows.Forms.Padding(2) 231 | Me.ComboBox1.Name = "ComboBox1" 232 | Me.ComboBox1.Size = New System.Drawing.Size(152, 20) 233 | Me.ComboBox1.TabIndex = 4 234 | ' 235 | 'Button5 236 | ' 237 | Me.Button5.Location = New System.Drawing.Point(356, 194) 238 | Me.Button5.Margin = New System.Windows.Forms.Padding(2) 239 | Me.Button5.Name = "Button5" 240 | Me.Button5.Size = New System.Drawing.Size(152, 27) 241 | Me.Button5.TabIndex = 20 242 | Me.Button5.Text = "修改当前" 243 | Me.Button5.UseVisualStyleBackColor = True 244 | ' 245 | 'Button6 246 | ' 247 | Me.Button6.Location = New System.Drawing.Point(208, 58) 248 | Me.Button6.Margin = New System.Windows.Forms.Padding(2) 249 | Me.Button6.Name = "Button6" 250 | Me.Button6.Size = New System.Drawing.Size(23, 79) 251 | Me.Button6.TabIndex = 21 252 | Me.Button6.Text = "↑" 253 | Me.Button6.UseVisualStyleBackColor = True 254 | ' 255 | 'Button7 256 | ' 257 | Me.Button7.Location = New System.Drawing.Point(208, 160) 258 | Me.Button7.Margin = New System.Windows.Forms.Padding(2) 259 | Me.Button7.Name = "Button7" 260 | Me.Button7.Size = New System.Drawing.Size(23, 75) 261 | Me.Button7.TabIndex = 22 262 | Me.Button7.Text = "↓" 263 | Me.Button7.UseVisualStyleBackColor = True 264 | ' 265 | 'Label7 266 | ' 267 | Me.Label7.AutoSize = True 268 | Me.Label7.Location = New System.Drawing.Point(420, 91) 269 | Me.Label7.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) 270 | Me.Label7.Name = "Label7" 271 | Me.Label7.Size = New System.Drawing.Size(53, 12) 272 | Me.Label7.TabIndex = 23 273 | Me.Label7.Text = "持续时间" 274 | ' 275 | 'CheckBox1 276 | ' 277 | Me.CheckBox1.AutoSize = True 278 | Me.CheckBox1.Checked = True 279 | Me.CheckBox1.CheckState = System.Windows.Forms.CheckState.Checked 280 | Me.CheckBox1.Location = New System.Drawing.Point(439, 230) 281 | Me.CheckBox1.Margin = New System.Windows.Forms.Padding(2) 282 | Me.CheckBox1.Name = "CheckBox1" 283 | Me.CheckBox1.Size = New System.Drawing.Size(72, 16) 284 | Me.CheckBox1.TabIndex = 24 285 | Me.CheckBox1.Text = "自动递增" 286 | Me.ToolTip1.SetToolTip(Me.CheckBox1, "单击""存入列表""后上课时间自动增加持续时间和课间时长") 287 | Me.CheckBox1.UseVisualStyleBackColor = True 288 | ' 289 | 'TextBox5 290 | ' 291 | Me.TextBox5.Location = New System.Drawing.Point(356, 226) 292 | Me.TextBox5.Margin = New System.Windows.Forms.Padding(2) 293 | Me.TextBox5.Name = "TextBox5" 294 | Me.TextBox5.Size = New System.Drawing.Size(48, 21) 295 | Me.TextBox5.TabIndex = 25 296 | Me.TextBox5.Text = "10" 297 | ' 298 | 'Label8 299 | ' 300 | Me.Label8.AutoSize = True 301 | Me.Label8.Location = New System.Drawing.Point(301, 230) 302 | Me.Label8.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) 303 | Me.Label8.Name = "Label8" 304 | Me.Label8.Size = New System.Drawing.Size(53, 12) 305 | Me.Label8.TabIndex = 26 306 | Me.Label8.Text = "课间时长" 307 | ' 308 | 'ToolTip1 309 | ' 310 | Me.ToolTip1.ToolTipTitle = "提示" 311 | ' 312 | 'Label9 313 | ' 314 | Me.Label9.AutoSize = True 315 | Me.Label9.Location = New System.Drawing.Point(406, 233) 316 | Me.Label9.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) 317 | Me.Label9.Name = "Label9" 318 | Me.Label9.Size = New System.Drawing.Size(29, 12) 319 | Me.Label9.TabIndex = 27 320 | Me.Label9.Text = "分钟" 321 | ' 322 | 'Label10 323 | ' 324 | Me.Label10.AutoSize = True 325 | Me.Label10.Location = New System.Drawing.Point(380, 93) 326 | Me.Label10.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) 327 | Me.Label10.Name = "Label10" 328 | Me.Label10.Size = New System.Drawing.Size(11, 12) 329 | Me.Label10.TabIndex = 28 330 | Me.Label10.Text = ":" 331 | ' 332 | 'StatusStrip1 333 | ' 334 | Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripStatusLabel1, Me.ProgressBar1}) 335 | Me.StatusStrip1.Location = New System.Drawing.Point(0, 332) 336 | Me.StatusStrip1.Name = "StatusStrip1" 337 | Me.StatusStrip1.Size = New System.Drawing.Size(534, 22) 338 | Me.StatusStrip1.TabIndex = 29 339 | Me.StatusStrip1.Text = "StatusStrip1" 340 | ' 341 | 'ToolStripStatusLabel1 342 | ' 343 | Me.ToolStripStatusLabel1.AutoSize = False 344 | Me.ToolStripStatusLabel1.Name = "ToolStripStatusLabel1" 345 | Me.ToolStripStatusLabel1.Size = New System.Drawing.Size(134, 17) 346 | Me.ToolStripStatusLabel1.Text = "串口未连接" 347 | ' 348 | 'ProgressBar1 349 | ' 350 | Me.ProgressBar1.Name = "ProgressBar1" 351 | Me.ProgressBar1.Size = New System.Drawing.Size(100, 16) 352 | ' 353 | 'Button8 354 | ' 355 | Me.Button8.Enabled = False 356 | Me.Button8.Location = New System.Drawing.Point(130, 11) 357 | Me.Button8.Name = "Button8" 358 | Me.Button8.Size = New System.Drawing.Size(75, 20) 359 | Me.Button8.TabIndex = 30 360 | Me.Button8.Text = "断开连接" 361 | Me.Button8.UseVisualStyleBackColor = True 362 | ' 363 | 'Form1 364 | ' 365 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!) 366 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font 367 | Me.ClientSize = New System.Drawing.Size(534, 354) 368 | Me.Controls.Add(Me.Button8) 369 | Me.Controls.Add(Me.StatusStrip1) 370 | Me.Controls.Add(Me.Label10) 371 | Me.Controls.Add(Me.Label9) 372 | Me.Controls.Add(Me.Label8) 373 | Me.Controls.Add(Me.TextBox5) 374 | Me.Controls.Add(Me.CheckBox1) 375 | Me.Controls.Add(Me.Label7) 376 | Me.Controls.Add(Me.Button7) 377 | Me.Controls.Add(Me.Button6) 378 | Me.Controls.Add(Me.Button5) 379 | Me.Controls.Add(Me.TextBox6) 380 | Me.Controls.Add(Me.TextBox4) 381 | Me.Controls.Add(Me.TextBox3) 382 | Me.Controls.Add(Me.TextBox2) 383 | Me.Controls.Add(Me.Button4) 384 | Me.Controls.Add(Me.Label6) 385 | Me.Controls.Add(Me.Label5) 386 | Me.Controls.Add(Me.ComboBox3) 387 | Me.Controls.Add(Me.Button3) 388 | Me.Controls.Add(Me.Button2) 389 | Me.Controls.Add(Me.Label4) 390 | Me.Controls.Add(Me.Label3) 391 | Me.Controls.Add(Me.Label2) 392 | Me.Controls.Add(Me.ComboBox2) 393 | Me.Controls.Add(Me.ComboBox1) 394 | Me.Controls.Add(Me.ListBox1) 395 | Me.Controls.Add(Me.Button1) 396 | Me.Margin = New System.Windows.Forms.Padding(2) 397 | Me.MaximizeBox = False 398 | Me.MinimizeBox = False 399 | Me.Name = "Form1" 400 | Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen 401 | Me.Text = "课程管理工具" 402 | Me.StatusStrip1.ResumeLayout(False) 403 | Me.StatusStrip1.PerformLayout() 404 | Me.ResumeLayout(False) 405 | Me.PerformLayout() 406 | 407 | End Sub 408 | 409 | Friend WithEvents SerialPort1 As IO.Ports.SerialPort 410 | Friend WithEvents Button1 As Button 411 | Friend WithEvents ListBox1 As ListBox 412 | Friend WithEvents ComboBox2 As ComboBox 413 | Friend WithEvents Label2 As Label 414 | Friend WithEvents Label3 As Label 415 | Friend WithEvents Label4 As Label 416 | Friend WithEvents Button2 As Button 417 | Friend WithEvents Button3 As Button 418 | Friend WithEvents ComboBox3 As ComboBox 419 | Friend WithEvents Label5 As Label 420 | Friend WithEvents Label6 As Label 421 | Friend WithEvents Button4 As Button 422 | Friend WithEvents TextBox2 As TextBox 423 | Friend WithEvents TextBox3 As TextBox 424 | Friend WithEvents TextBox4 As TextBox 425 | Friend WithEvents TextBox6 As TextBox 426 | Friend WithEvents ComboBox1 As ComboBox 427 | Friend WithEvents Button5 As Button 428 | Friend WithEvents Button6 As Button 429 | Friend WithEvents Button7 As Button 430 | Friend WithEvents Label7 As Label 431 | Friend WithEvents CheckBox1 As CheckBox 432 | Friend WithEvents TextBox5 As TextBox 433 | Friend WithEvents Label8 As Label 434 | Friend WithEvents ToolTip1 As ToolTip 435 | Friend WithEvents Label9 As Label 436 | Friend WithEvents Label10 As Label 437 | Friend WithEvents StatusStrip1 As StatusStrip 438 | Friend WithEvents ToolStripStatusLabel1 As ToolStripStatusLabel 439 | Friend WithEvents ProgressBar1 As ToolStripProgressBar 440 | Friend WithEvents Button8 As Button 441 | End Class 442 | -------------------------------------------------------------------------------- /上位机/WindowsApp1/Form1.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | 148, 14 125 | 126 | 127 | 148, 14 128 | 129 | 130 | 251, 14 131 | 132 | -------------------------------------------------------------------------------- /上位机/WindowsApp1/Form1.vb: -------------------------------------------------------------------------------- 1 | Imports System.IO.Ports 2 | 3 | Public Class Form1 4 | Public Structure Cls 5 | Dim week As Byte 6 | Dim type As Byte 7 | Dim start_time As UInt16 8 | Dim end_time As UInt16 9 | Dim ring As Byte 10 | Dim ring_time As Byte 11 | End Structure 12 | Private classArr(256) As Cls 13 | Private classTypes() As String = {"数学", "语文", "英语", "政治", "历史", "地理", "生物", "物理", "化学", "自习", "体育", "班会", "音美"} 14 | Private classTotal = 0 15 | Private currentSerial = 1 16 | Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click 17 | If SerialPort1.IsOpen = True Then 18 | SerialPort1.Close() 19 | End If 20 | For i = 1 To 16 21 | If currentSerial = 16 Then 22 | currentSerial = 1 23 | End If 24 | currentSerial = currentSerial + 1 25 | SerialPort1.PortName = "COM" + Str(currentSerial) 26 | SerialPort1.PortName = System.Text.RegularExpressions.Regex.Replace(SerialPort1.PortName, " ", String.Empty, System.Text.RegularExpressions.RegexOptions.IgnoreCase) 27 | Try 28 | SerialPort1.Open() 29 | Button2.Enabled = True 30 | Button3.Enabled = True 31 | Button4.Enabled = True 32 | Button8.Enabled = True 33 | ToolStripStatusLabel1.Text = "已连接:" + SerialPort1.PortName 34 | Button1.Text = "尝试下一个" 35 | Exit For 36 | Catch 37 | End Try 38 | Next i 39 | If SerialPort1.IsOpen = False Then 40 | MsgBox("连接失败") 41 | End If 42 | End Sub 43 | 44 | Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click 45 | Dim i As Integer 46 | If SerialPort1.IsOpen = False Then 47 | Button2.Enabled = False 48 | Button3.Enabled = False 49 | Button4.Enabled = False 50 | Exit Sub 51 | End If 52 | classTotal = 0 53 | ListBox1.Items.Clear() 54 | Button2.Enabled = False 55 | Button3.Enabled = False 56 | Button4.Enabled = False 57 | ListBox1.Enabled = False 58 | ProgressBar1.Value = 0 59 | Try 60 | SerialPort1.Write("r") 61 | classTotal = 0 62 | For i = 0 To 254 63 | ProgressBar1.Value = Int((i + 1) / 255 * 100) 64 | classArr(i).week = SerialPort1.ReadByte() - 1 65 | classArr(i).type = SerialPort1.ReadByte() 66 | classArr(i).start_time = SerialPort1.ReadByte() * 256 67 | classArr(i).start_time += SerialPort1.ReadByte() 68 | classArr(i).end_time = SerialPort1.ReadByte() * 256 69 | classArr(i).end_time += SerialPort1.ReadByte() 70 | classArr(i).ring = SerialPort1.ReadByte() 71 | classArr(i).ring_time = SerialPort1.ReadByte() 72 | If classArr(i).type < classTypes.Length And Not classArr(i).week = 255 Then 73 | classTotal = classTotal + 1 74 | ListBox1.Items.Add(classTypes(classArr(i).type)) 75 | End If 76 | Update() 77 | Next 78 | Catch ex As Exception 79 | MsgBox(ex.Message, MsgBoxStyle.Critical) 80 | End Try 81 | Button2.Enabled = True 82 | ListBox1.Enabled = True 83 | Button3.Enabled = True 84 | Button4.Enabled = True 85 | End Sub 86 | 87 | Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged 88 | If ListBox1.SelectedIndex = -1 Then 89 | Exit Sub 90 | End If 91 | ComboBox1.SelectedIndex = classArr(ListBox1.SelectedIndex).week 92 | ComboBox2.SelectedIndex = classArr(ListBox1.SelectedIndex).type 93 | TextBox2.Text = Int(classArr(ListBox1.SelectedIndex).start_time / 60) 94 | TextBox3.Text = classArr(ListBox1.SelectedIndex).start_time Mod 60 95 | TextBox4.Text = Int(classArr(ListBox1.SelectedIndex).end_time - classArr(ListBox1.SelectedIndex).start_time) 96 | ComboBox3.SelectedIndex = classArr(ListBox1.SelectedIndex).ring 97 | TextBox6.Text = classArr(ListBox1.SelectedIndex).ring_time 98 | End Sub 99 | 100 | Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load 101 | For i = 0 To classTypes.Length - 1 102 | ComboBox2.Items.Add(classTypes(i)) 103 | Next 104 | ComboBox2.SelectedIndex = 0 105 | ComboBox1.SelectedIndex = 0 106 | ComboBox3.SelectedIndex = 2 107 | End Sub 108 | 109 | Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click 110 | Dim dat As Byte 111 | If SerialPort1.IsOpen = False Then 112 | Button2.Enabled = False 113 | Button3.Enabled = False 114 | Button4.Enabled = False 115 | Exit Sub 116 | End If 117 | 118 | Button2.Enabled = False 119 | Button3.Enabled = False 120 | Button4.Enabled = False 121 | ListBox1.Enabled = False 122 | ProgressBar1.Value = 0 123 | Try 124 | SerialPort1.Write("w") 125 | dat = SerialPort1.ReadByte() 126 | SerialPort1.BaseStream.WriteByte(classTotal) 127 | 128 | For i = 0 To classTotal - 1 129 | ProgressBar1.Value = Int((i + 1) / (classTotal) * 100) 130 | SerialPort1.BaseStream.WriteByte(classArr(i).week + 1) 131 | SerialPort1.BaseStream.WriteByte(classArr(i).type) 132 | SerialPort1.BaseStream.WriteByte(Int(classArr(i).start_time \ 256)) 133 | SerialPort1.BaseStream.WriteByte(classArr(i).start_time Mod 256) 134 | SerialPort1.BaseStream.WriteByte(Int(classArr(i).end_time \ 256)) 135 | SerialPort1.BaseStream.WriteByte(classArr(i).end_time Mod 256) 136 | SerialPort1.BaseStream.WriteByte(classArr(i).ring) 137 | SerialPort1.BaseStream.WriteByte(classArr(i).ring_time) 138 | SerialPort1.ReadByte() 139 | Next 140 | Catch ex As Exception 141 | MsgBox(ex.Message, MsgBoxStyle.Critical) 142 | End Try 143 | Button3.Enabled = True 144 | Button4.Enabled = True 145 | Button2.Enabled = True 146 | ListBox1.Enabled = True 147 | End Sub 148 | 149 | Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click 150 | ListBox1.Items.Add(ComboBox2.Text) 151 | classArr(classTotal).type = ComboBox2.SelectedIndex 152 | classArr(classTotal).week = ComboBox1.SelectedIndex 153 | classArr(classTotal).start_time = Int(TextBox2.Text) * 60 + Int(TextBox3.Text) 154 | classArr(classTotal).end_time = Int(TextBox4.Text + classArr(classTotal).start_time) 155 | classArr(classTotal).ring = ComboBox3.SelectedIndex 156 | classArr(classTotal).ring_time = Int(TextBox6.Text) 157 | classTotal = classTotal + 1 158 | If CheckBox1.Checked = True Then 159 | Dim i As Integer 160 | i = classArr(classTotal - 1).start_time 161 | i = i + Int(TextBox4.Text) + Int(TextBox5.Text) 162 | TextBox2.Text = Int(i / 60) 163 | TextBox3.Text = i Mod 60 164 | End If 165 | End Sub 166 | 167 | Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click 168 | Dim clstmp As Cls 169 | Dim sel As Integer 170 | If ListBox1.SelectedIndex = -1 Or ListBox1.SelectedIndex = 0 Then 171 | Exit Sub 172 | End If 173 | clstmp = classArr(ListBox1.SelectedIndex) 174 | classArr(ListBox1.SelectedIndex) = classArr(ListBox1.SelectedIndex - 1) 175 | classArr(ListBox1.SelectedIndex - 1) = clstmp 176 | sel = ListBox1.SelectedIndex 177 | ListBox1.Items.RemoveAt(ListBox1.SelectedIndex) 178 | ListBox1.Items.Insert(sel - 1, classTypes(clstmp.type)) 179 | ListBox1.SelectedIndex = sel - 1 180 | End Sub 181 | 182 | Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click 183 | Dim clstmp As Cls 184 | Dim sel As Integer 185 | If ListBox1.SelectedIndex = -1 Or ListBox1.SelectedIndex = ListBox1.Items.Count - 1 Then 186 | Exit Sub 187 | End If 188 | clstmp = classArr(ListBox1.SelectedIndex) 189 | classArr(ListBox1.SelectedIndex) = classArr(ListBox1.SelectedIndex + 1) 190 | classArr(ListBox1.SelectedIndex + 1) = clstmp 191 | sel = ListBox1.SelectedIndex 192 | ListBox1.Items.RemoveAt(ListBox1.SelectedIndex) 193 | ListBox1.Items.Insert(sel + 1, classTypes(clstmp.type)) 194 | ListBox1.SelectedIndex = sel + 1 195 | End Sub 196 | 197 | Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click 198 | Dim sel As Integer 199 | If ListBox1.SelectedIndex = -1 Then 200 | Exit Sub 201 | End If 202 | sel = ListBox1.SelectedIndex 203 | ListBox1.Items.RemoveAt(sel) 204 | ListBox1.Items.Insert(sel, classTypes(ComboBox2.SelectedIndex)) 205 | classArr(sel).type = ComboBox2.SelectedIndex 206 | classArr(sel).week = ComboBox1.SelectedIndex 207 | classArr(sel).start_time = Int(TextBox2.Text) * 60 + Int(TextBox3.Text) 208 | classArr(sel).end_time = Int(TextBox4.Text + classArr(sel).start_time) 209 | classArr(sel).ring = ComboBox3.SelectedIndex 210 | classArr(sel).ring_time = Int(TextBox6.Text) 211 | ListBox1.SelectedIndex = sel 212 | End Sub 213 | 214 | Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click 215 | If SerialPort1.IsOpen = False Then 216 | Button8.Enabled = False 217 | Exit Sub 218 | End If 219 | Button8.Enabled = False 220 | SerialPort1.Close() 221 | Button2.Enabled = False 222 | Button3.Enabled = False 223 | Button4.Enabled = False 224 | Button8.Enabled = False 225 | End Sub 226 | End Class 227 | -------------------------------------------------------------------------------- /上位机/WindowsApp1/My Project/Application.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.42000 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | 15 | Namespace My 16 | 17 | 'NOTE: This file is auto-generated; do not modify it directly. To make changes, 18 | ' or if you encounter build errors in this file, go to the Project Designer 19 | ' (go to Project Properties or double-click the My Project node in 20 | ' Solution Explorer), and make changes on the Application tab. 21 | ' 22 | Partial Friend Class MyApplication 23 | 24 | _ 25 | Public Sub New() 26 | MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) 27 | Me.IsSingleInstance = false 28 | Me.EnableVisualStyles = true 29 | Me.SaveMySettingsOnExit = true 30 | Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses 31 | End Sub 32 | 33 | _ 34 | Protected Overrides Sub OnCreateMainForm() 35 | Me.MainForm = Global.WindowsApp1.Form1 36 | End Sub 37 | End Class 38 | End Namespace 39 | -------------------------------------------------------------------------------- /上位机/WindowsApp1/My Project/Application.myapp: -------------------------------------------------------------------------------- 1 |  2 | 3 | true 4 | Form1 5 | false 6 | 0 7 | true 8 | 0 9 | 0 10 | true 11 | 12 | -------------------------------------------------------------------------------- /上位机/WindowsApp1/My Project/AssemblyInfo.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Reflection 3 | Imports System.Runtime.InteropServices 4 | 5 | ' 有关程序集的一般信息由以下 6 | ' 控制。更改这些特性值可修改 7 | ' 与程序集关联的信息。 8 | 9 | '查看程序集特性的值 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | '如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 21 | 22 | 23 | ' 程序集的版本信息由下列四个值组成: 24 | ' 25 | ' 主版本 26 | ' 次版本 27 | ' 生成号 28 | ' 修订号 29 | ' 30 | ' 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 31 | ' 方法是按如下所示使用“*”: : 32 | ' 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /上位机/WindowsApp1/My Project/Resources.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.42000 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | 15 | Namespace My.Resources 16 | 17 | 'This class was auto-generated by the StronglyTypedResourceBuilder 18 | 'class via a tool like ResGen or Visual Studio. 19 | 'To add or remove a member, edit your .ResX file then rerun ResGen 20 | 'with the /str option, or rebuild your VS project. 21 | ''' 22 | ''' A strongly-typed resource class, for looking up localized strings, etc. 23 | ''' 24 | _ 28 | Friend Module Resources 29 | 30 | Private resourceMan As Global.System.Resources.ResourceManager 31 | 32 | Private resourceCulture As Global.System.Globalization.CultureInfo 33 | 34 | ''' 35 | ''' Returns the cached ResourceManager instance used by this class. 36 | ''' 37 | _ 38 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager 39 | Get 40 | If Object.ReferenceEquals(resourceMan, Nothing) Then 41 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WindowsApp1.Resources", GetType(Resources).Assembly) 42 | resourceMan = temp 43 | End If 44 | Return resourceMan 45 | End Get 46 | End Property 47 | 48 | ''' 49 | ''' Overrides the current thread's CurrentUICulture property for all 50 | ''' resource lookups using this strongly typed resource class. 51 | ''' 52 | _ 53 | Friend Property Culture() As Global.System.Globalization.CultureInfo 54 | Get 55 | Return resourceCulture 56 | End Get 57 | Set(ByVal value As Global.System.Globalization.CultureInfo) 58 | resourceCulture = value 59 | End Set 60 | End Property 61 | End Module 62 | End Namespace 63 | -------------------------------------------------------------------------------- /上位机/WindowsApp1/My Project/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /上位机/WindowsApp1/My Project/Settings.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.42000 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | 15 | Namespace My 16 | 17 | _ 20 | Partial Friend NotInheritable Class MySettings 21 | Inherits Global.System.Configuration.ApplicationSettingsBase 22 | 23 | Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) 24 | 25 | #Region "My.Settings Auto-Save Functionality" 26 | #If _MyType = "WindowsForms" Then 27 | Private Shared addedHandler As Boolean 28 | 29 | Private Shared addedHandlerLockObject As New Object 30 | 31 | _ 32 | Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) 33 | If My.Application.SaveMySettingsOnExit Then 34 | My.Settings.Save() 35 | End If 36 | End Sub 37 | #End If 38 | #End Region 39 | 40 | Public Shared ReadOnly Property [Default]() As MySettings 41 | Get 42 | 43 | #If _MyType = "WindowsForms" Then 44 | If Not addedHandler Then 45 | SyncLock addedHandlerLockObject 46 | If Not addedHandler Then 47 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings 48 | addedHandler = True 49 | End If 50 | End SyncLock 51 | End If 52 | #End If 53 | Return defaultInstance 54 | End Get 55 | End Property 56 | End Class 57 | End Namespace 58 | 59 | Namespace My 60 | 61 | _ 64 | Friend Module MySettingsProperty 65 | 66 | _ 67 | Friend ReadOnly Property Settings() As Global.WindowsApp1.My.MySettings 68 | Get 69 | Return Global.WindowsApp1.My.MySettings.Default 70 | End Get 71 | End Property 72 | End Module 73 | End Namespace 74 | -------------------------------------------------------------------------------- /上位机/WindowsApp1/My Project/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /上位机/WindowsApp1/WindowsApp1.vbproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {0B7A6F45-7A51-4B63-A8BD-76EF602F86F1} 8 | WinExe 9 | WindowsApp1.My.MyApplication 10 | WindowsApp1 11 | WindowsApp1 12 | 512 13 | WindowsForms 14 | v4.6.1 15 | true 16 | true 17 | C:\Users\14522\Desktop\WebSite\ 18 | true 19 | Disk 20 | false 21 | Foreground 22 | 7 23 | Days 24 | false 25 | false 26 | true 27 | 0 28 | 1.0.0.%2a 29 | false 30 | false 31 | true 32 | 33 | 34 | AnyCPU 35 | true 36 | full 37 | true 38 | true 39 | bin\Debug\ 40 | WindowsApp1.xml 41 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 42 | 43 | 44 | AnyCPU 45 | pdbonly 46 | false 47 | true 48 | true 49 | bin\Release\ 50 | WindowsApp1.xml 51 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 52 | 53 | 54 | On 55 | 56 | 57 | Binary 58 | 59 | 60 | Off 61 | 62 | 63 | On 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | Form 93 | 94 | 95 | Form1.vb 96 | Form 97 | 98 | 99 | 100 | True 101 | Application.myapp 102 | 103 | 104 | True 105 | True 106 | Resources.resx 107 | 108 | 109 | True 110 | Settings.settings 111 | True 112 | 113 | 114 | 115 | 116 | Form1.vb 117 | 118 | 119 | VbMyResourcesResXFileCodeGenerator 120 | Resources.Designer.vb 121 | My.Resources 122 | Designer 123 | 124 | 125 | 126 | 127 | MyApplicationCodeGenerator 128 | Application.Designer.vb 129 | 130 | 131 | SettingsSingleFileGenerator 132 | My 133 | Settings.Designer.vb 134 | 135 | 136 | 137 | 138 | 139 | False 140 | Microsoft .NET Framework 4.6.1 %28x86 和 x64%29 141 | true 142 | 143 | 144 | False 145 | .NET Framework 3.5 SP1 146 | false 147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /上位机/WindowsApp1/WindowsApp1.vbproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | zh-CN 11 | false 12 | 13 | -------------------------------------------------------------------------------- /上位机/WindowsApp1/WindowsApp1_TemporaryKey.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/上位机/WindowsApp1/WindowsApp1_TemporaryKey.pfx -------------------------------------------------------------------------------- /上位机/WindowsApp1/bin/Debug/WindowsApp1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/上位机/WindowsApp1/bin/Debug/WindowsApp1.exe -------------------------------------------------------------------------------- /上位机/WindowsApp1/bin/Debug/WindowsApp1.exe.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /上位机/WindowsApp1/bin/Debug/WindowsApp1.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/上位机/WindowsApp1/bin/Debug/WindowsApp1.pdb -------------------------------------------------------------------------------- /上位机/WindowsApp1/bin/Debug/WindowsApp1.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | WindowsApp1 6 | 7 | 8 | 9 | 10 | 11 | A strongly-typed resource class, for looking up localized strings, etc. 12 | 13 | 14 | 15 | 16 | Returns the cached ResourceManager instance used by this class. 17 | 18 | 19 | 20 | 21 | Overrides the current thread's CurrentUICulture property for all 22 | resource lookups using this strongly typed resource class. 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /上位机/WindowsApp1/bin/Release/WindowsApp1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/上位机/WindowsApp1/bin/Release/WindowsApp1.exe -------------------------------------------------------------------------------- /上位机/WindowsApp1/bin/Release/WindowsApp1.exe.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /上位机/WindowsApp1/bin/Release/WindowsApp1.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/上位机/WindowsApp1/bin/Release/WindowsApp1.pdb -------------------------------------------------------------------------------- /上位机/WindowsApp1/bin/Release/WindowsApp1.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | WindowsApp1 6 | 7 | 8 | 9 | 10 | 11 | A strongly-typed resource class, for looking up localized strings, etc. 12 | 13 | 14 | 15 | 16 | Returns the cached ResourceManager instance used by this class. 17 | 18 | 19 | 20 | 21 | Overrides the current thread's CurrentUICulture property for all 22 | resource lookups using this strongly typed resource class. 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /上位机/WindowsApp1/obj/Debug/DesignTimeResolveAssemblyReferences.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/上位机/WindowsApp1/obj/Debug/DesignTimeResolveAssemblyReferences.cache -------------------------------------------------------------------------------- /上位机/WindowsApp1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/上位机/WindowsApp1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /上位机/WindowsApp1/obj/Debug/TempPE/My Project.Resources.Designer.vb.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/上位机/WindowsApp1/obj/Debug/TempPE/My Project.Resources.Designer.vb.dll -------------------------------------------------------------------------------- /上位机/WindowsApp1/obj/Debug/WindowsApp1.Form1.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/上位机/WindowsApp1/obj/Debug/WindowsApp1.Form1.resources -------------------------------------------------------------------------------- /上位机/WindowsApp1/obj/Debug/WindowsApp1.Resources.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/上位机/WindowsApp1/obj/Debug/WindowsApp1.Resources.resources -------------------------------------------------------------------------------- /上位机/WindowsApp1/obj/Debug/WindowsApp1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/上位机/WindowsApp1/obj/Debug/WindowsApp1.exe -------------------------------------------------------------------------------- /上位机/WindowsApp1/obj/Debug/WindowsApp1.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/上位机/WindowsApp1/obj/Debug/WindowsApp1.pdb -------------------------------------------------------------------------------- /上位机/WindowsApp1/obj/Debug/WindowsApp1.vbproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 7b9e9c85a3833aec9037b3a3d2e86cf5870234cb 2 | -------------------------------------------------------------------------------- /上位机/WindowsApp1/obj/Debug/WindowsApp1.vbproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\14522\source\repos\WindowsApp1\WindowsApp1\bin\Debug\WindowsApp1.exe.config 2 | C:\Users\14522\source\repos\WindowsApp1\WindowsApp1\bin\Debug\WindowsApp1.exe 3 | C:\Users\14522\source\repos\WindowsApp1\WindowsApp1\bin\Debug\WindowsApp1.pdb 4 | C:\Users\14522\source\repos\WindowsApp1\WindowsApp1\bin\Debug\WindowsApp1.xml 5 | C:\Users\14522\source\repos\WindowsApp1\WindowsApp1\obj\Debug\WindowsApp1.vbprojAssemblyReference.cache 6 | C:\Users\14522\source\repos\WindowsApp1\WindowsApp1\obj\Debug\WindowsApp1.Form1.resources 7 | C:\Users\14522\source\repos\WindowsApp1\WindowsApp1\obj\Debug\WindowsApp1.Resources.resources 8 | C:\Users\14522\source\repos\WindowsApp1\WindowsApp1\obj\Debug\WindowsApp1.vbproj.GenerateResource.cache 9 | C:\Users\14522\source\repos\WindowsApp1\WindowsApp1\obj\Debug\WindowsApp1.vbproj.CoreCompileInputs.cache 10 | C:\Users\14522\source\repos\WindowsApp1\WindowsApp1\obj\Debug\WindowsApp1.exe 11 | C:\Users\14522\source\repos\WindowsApp1\WindowsApp1\obj\Debug\WindowsApp1.xml 12 | C:\Users\14522\source\repos\WindowsApp1\WindowsApp1\obj\Debug\WindowsApp1.pdb 13 | C:\Users\14522\Desktop\WindowsApp1\WindowsApp1\bin\Debug\WindowsApp1.exe.config 14 | C:\Users\14522\Desktop\WindowsApp1\WindowsApp1\bin\Debug\WindowsApp1.exe 15 | C:\Users\14522\Desktop\WindowsApp1\WindowsApp1\bin\Debug\WindowsApp1.pdb 16 | C:\Users\14522\Desktop\WindowsApp1\WindowsApp1\bin\Debug\WindowsApp1.xml 17 | C:\Users\14522\Desktop\WindowsApp1\WindowsApp1\obj\Debug\WindowsApp1.Form1.resources 18 | C:\Users\14522\Desktop\WindowsApp1\WindowsApp1\obj\Debug\WindowsApp1.Resources.resources 19 | C:\Users\14522\Desktop\WindowsApp1\WindowsApp1\obj\Debug\WindowsApp1.vbproj.GenerateResource.cache 20 | C:\Users\14522\Desktop\WindowsApp1\WindowsApp1\obj\Debug\WindowsApp1.vbproj.CoreCompileInputs.cache 21 | C:\Users\14522\Desktop\WindowsApp1\WindowsApp1\obj\Debug\WindowsApp1.exe 22 | C:\Users\14522\Desktop\WindowsApp1\WindowsApp1\obj\Debug\WindowsApp1.xml 23 | C:\Users\14522\Desktop\WindowsApp1\WindowsApp1\obj\Debug\WindowsApp1.pdb 24 | C:\Users\14522\Desktop\WindowsApp1\WindowsApp1\obj\Debug\WindowsApp1.vbprojAssemblyReference.cache 25 | -------------------------------------------------------------------------------- /上位机/WindowsApp1/obj/Debug/WindowsApp1.vbproj.GenerateResource.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/上位机/WindowsApp1/obj/Debug/WindowsApp1.vbproj.GenerateResource.cache -------------------------------------------------------------------------------- /上位机/WindowsApp1/obj/Debug/WindowsApp1.vbprojAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/上位机/WindowsApp1/obj/Debug/WindowsApp1.vbprojAssemblyReference.cache -------------------------------------------------------------------------------- /上位机/WindowsApp1/obj/Debug/WindowsApp1.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | WindowsApp1 6 | 7 | 8 | 9 | 10 | 11 | A strongly-typed resource class, for looking up localized strings, etc. 12 | 13 | 14 | 15 | 16 | Returns the cached ResourceManager instance used by this class. 17 | 18 | 19 | 20 | 21 | Overrides the current thread's CurrentUICulture property for all 22 | resource lookups using this strongly typed resource class. 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /中文字库/16X16.FON: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/中文字库/16X16.FON -------------------------------------------------------------------------------- /中文字库/README.MD: -------------------------------------------------------------------------------- 1 | # 必须将此文件刷入SPI FLASH,不然无法显示中文 2 | -------------------------------------------------------------------------------- /源代码/Graph.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Graph.c -------------------------------------------------------------------------------- /源代码/Graph.h: -------------------------------------------------------------------------------- 1 | #ifndef __GRAPH_H__ 2 | #define __GRAPH_H__ 3 | 4 | 5 | void graph_init(); 6 | void graph_add_num(float num); 7 | void graph_draw(void); 8 | void graph_move_axis(int8_t offset); 9 | 10 | 11 | #endif -------------------------------------------------------------------------------- /源代码/Listings/Graph.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Listings/Graph.lst -------------------------------------------------------------------------------- /源代码/Listings/STARTUP.lst: -------------------------------------------------------------------------------- 1 | A51 MACRO ASSEMBLER STARTUP 01/26/2021 18:03:16 PAGE 1 2 | 3 | 4 | MACRO ASSEMBLER A51 V8.2.5.0 5 | OBJECT MODULE PLACED IN .\Objects\STARTUP.obj 6 | ASSEMBLER INVOKED BY: C:\Keil_v5\C51\BIN\A51.EXE STARTUP.A51 SET(LARGE) DEBUG PRINT(.\Listings\STARTUP.lst) OBJECT(.\Obj 7 | ects\STARTUP.obj) EP 8 | 9 | LOC OBJ LINE SOURCE 10 | 11 | 1 $nomod51 12 | 13 | 2 ;------------------------------------------------------------------------------ 14 | 15 | 3 ; This file is part of the C51 Compiler package 16 | 17 | 4 ; Copyright (c) 1988-2005 Keil Elektronik GmbH and Keil Software, Inc. 18 | 19 | 5 ; Version 8.01 20 | 21 | 6 ; 22 | 23 | 7 ; *** <<< Use Configuration Wizard in Context Menu >>> *** 24 | 25 | 8 ;------------------------------------------------------------------------------ 26 | 27 | 9 ; STARTUP.A51: This code is executed after processor reset. 28 | 29 | 10 ; 30 | 31 | 11 ; To translate this file use A51 with the following invocation: 32 | 33 | 12 ; 34 | 35 | 13 ; A51 STARTUP.A51 36 | 37 | 14 ; 38 | 39 | 15 ; To link the modified STARTUP.OBJ file to your application use the following 40 | 41 | 16 ; Lx51 invocation: 42 | 43 | 17 ; 44 | 45 | 18 ; Lx51 your object file list, STARTUP.OBJ controls 46 | 47 | 19 ; 48 | 49 | 20 ;------------------------------------------------------------------------------ 50 | 51 | 21 ; 52 | 53 | 22 ; User-defined Power-On Initialization of Memory 54 | 55 | 23 ; 56 | 57 | 24 ; With the following EQU statements the initialization of memory 58 | 59 | 25 ; at processor reset can be defined: 60 | 61 | 26 ; 62 | 63 | 27 ; IDATALEN: IDATA memory size <0x0-0x100> 64 | 65 | 28 ; Note: The absolute start-address of IDATA memory is always 0 66 | 67 | 29 ; The IDATA space overlaps physically the DATA and BIT areas. 68 | 69 | 0080 30 IDATALEN EQU 80H 70 | 71 | 31 ; 72 | 73 | 32 ; XDATASTART: XDATA memory start address <0x0-0xFFFF> 74 | 75 | 33 ; The absolute start address of XDATA memory 76 | 77 | 0000 34 XDATASTART EQU 0 78 | 79 | 35 ; 80 | 81 | 36 ; XDATALEN: XDATA memory size <0x0-0xFFFF> 82 | 83 | 37 ; The length of XDATA memory in bytes. 84 | 85 | 0000 38 XDATALEN EQU 0 86 | 87 | 39 ; 88 | 89 | 40 ; PDATASTART: PDATA memory start address <0x0-0xFFFF> 90 | 91 | 41 ; The absolute start address of PDATA memory 92 | 93 | 0000 42 PDATASTART EQU 0H 94 | 95 | 43 ; 96 | 97 | 44 ; PDATALEN: PDATA memory size <0x0-0xFF> 98 | 99 | 45 ; The length of PDATA memory in bytes. 100 | 101 | 0000 46 PDATALEN EQU 0H 102 | 103 | 47 ; 104 | 105 | 48 ; 106 | 107 | 49 ;------------------------------------------------------------------------------ 108 | 109 | 50 ; 110 | 111 | 51 ; Reentrant Stack Initialization 112 | 113 | 52 ; 114 | 115 | 53 ; The following EQU statements define the stack pointer for reentrant 116 | 117 | 54 ; functions and initialized it: 118 | 119 | 55 ; 120 | 121 | 56 ; Stack Space for reentrant functions in the SMALL model. 122 | 123 | 57 ; IBPSTACK: Enable SMALL model reentrant stack 124 | 125 | A51 MACRO ASSEMBLER STARTUP 01/26/2021 18:03:16 PAGE 2 126 | 127 | 58 ; Stack space for reentrant functions in the SMALL model. 128 | 129 | 0000 59 IBPSTACK EQU 0 ; set to 1 if small reentrant is used. 130 | 131 | 60 ; IBPSTACKTOP: End address of SMALL model stack <0x0-0xFF> 132 | 133 | 61 ; Set the top of the stack to the highest location. 134 | 135 | 0100 62 IBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1 136 | 137 | 63 ; 138 | 139 | 64 ; 140 | 141 | 65 ; Stack Space for reentrant functions in the LARGE model. 142 | 143 | 66 ; XBPSTACK: Enable LARGE model reentrant stack 144 | 145 | 67 ; Stack space for reentrant functions in the LARGE model. 146 | 147 | 0000 68 XBPSTACK EQU 0 ; set to 1 if large reentrant is used. 148 | 149 | 69 ; XBPSTACKTOP: End address of LARGE model stack <0x0-0xFFFF> 150 | 151 | 70 ; Set the top of the stack to the highest location. 152 | 153 | 0000 71 XBPSTACKTOP EQU 0xFFFF +1 ; default 0FFFFH+1 154 | 155 | 72 ; 156 | 157 | 73 ; 158 | 159 | 74 ; Stack Space for reentrant functions in the COMPACT model. 160 | 161 | 75 ; PBPSTACK: Enable COMPACT model reentrant stack 162 | 163 | 76 ; Stack space for reentrant functions in the COMPACT model. 164 | 165 | 0000 77 PBPSTACK EQU 0 ; set to 1 if compact reentrant is used. 166 | 167 | 78 ; 168 | 169 | 79 ; PBPSTACKTOP: End address of COMPACT model stack <0x0-0xFFFF> 170 | 171 | 80 ; Set the top of the stack to the highest location. 172 | 173 | 0100 81 PBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1 174 | 175 | 82 ; 176 | 177 | 83 ; 178 | 179 | 84 ;------------------------------------------------------------------------------ 180 | 181 | 85 ; 182 | 183 | 86 ; Memory Page for Using the Compact Model with 64 KByte xdata RAM 184 | 185 | 87 ; Compact Model Page Definition 186 | 187 | 88 ; 188 | 189 | 89 ; Define the XDATA page used for PDATA variables. 190 | 191 | 90 ; PPAGE must conform with the PPAGE set in the linker invocation. 192 | 193 | 91 ; 194 | 195 | 92 ; Enable pdata memory page initalization 196 | 197 | 0000 93 PPAGEENABLE EQU 0 ; set to 1 if pdata object are used. 198 | 199 | 94 ; 200 | 201 | 95 ; PPAGE number <0x0-0xFF> 202 | 203 | 96 ; uppermost 256-byte address of the page used for PDATA variables. 204 | 205 | 0000 97 PPAGE EQU 0 206 | 207 | 98 ; 208 | 209 | 99 ; SFR address which supplies uppermost address byte <0x0-0xFF> 210 | 211 | 100 ; most 8051 variants use P2 as uppermost address byte 212 | 213 | 00A0 101 PPAGE_SFR DATA 0A0H 214 | 215 | 102 ; 216 | 217 | 103 ; 218 | 219 | 104 ;------------------------------------------------------------------------------ 220 | 221 | 105 222 | 223 | 106 ; Standard SFR Symbols 224 | 225 | 00E0 107 ACC DATA 0E0H 226 | 227 | 00F0 108 B DATA 0F0H 228 | 229 | 0081 109 SP DATA 81H 230 | 231 | 0082 110 DPL DATA 82H 232 | 233 | 0083 111 DPH DATA 83H 234 | 235 | 112 236 | 237 | 113 NAME ?C_STARTUP 238 | 239 | 114 240 | 241 | 115 242 | 243 | 116 ?C_C51STARTUP SEGMENT CODE 244 | 245 | 117 ?STACK SEGMENT IDATA 246 | 247 | 118 248 | 249 | ---- 119 RSEG ?STACK 250 | 251 | 0000 120 DS 1 252 | 253 | 121 254 | 255 | 122 EXTRN CODE (?C_START) 256 | 257 | 123 PUBLIC ?C_STARTUP 258 | 259 | A51 MACRO ASSEMBLER STARTUP 01/26/2021 18:03:16 PAGE 3 260 | 261 | 124 262 | 263 | ---- 125 CSEG AT 0 264 | 265 | 0000 020000 F 126 ?C_STARTUP: LJMP STARTUP1 266 | 267 | 127 268 | 269 | ---- 128 RSEG ?C_C51STARTUP 270 | 271 | 129 272 | 273 | 0000 130 STARTUP1: 274 | 275 | 131 276 | 277 | 132 IF IDATALEN <> 0 278 | 279 | 0000 787F 133 MOV R0,#IDATALEN - 1 280 | 281 | 0002 E4 134 CLR A 282 | 283 | 0003 F6 135 IDATALOOP: MOV @R0,A 284 | 285 | 0004 D8FD 136 DJNZ R0,IDATALOOP 286 | 287 | 137 ENDIF 288 | 289 | 138 290 | 291 | 139 IF XDATALEN <> 0 292 | 293 | MOV DPTR,#XDATASTART 294 | 295 | MOV R7,#LOW (XDATALEN) 296 | 297 | IF (LOW (XDATALEN)) <> 0 298 | 299 | MOV R6,#(HIGH (XDATALEN)) +1 300 | 301 | ELSE 302 | 303 | MOV R6,#HIGH (XDATALEN) 304 | 305 | ENDIF 306 | 307 | CLR A 308 | 309 | XDATALOOP: MOVX @DPTR,A 310 | 311 | INC DPTR 312 | 313 | DJNZ R7,XDATALOOP 314 | 315 | DJNZ R6,XDATALOOP 316 | 317 | ENDIF 318 | 319 | 153 320 | 321 | 154 IF PPAGEENABLE <> 0 322 | 323 | MOV PPAGE_SFR,#PPAGE 324 | 325 | ENDIF 326 | 327 | 157 328 | 329 | 158 IF PDATALEN <> 0 330 | 331 | MOV R0,#LOW (PDATASTART) 332 | 333 | MOV R7,#LOW (PDATALEN) 334 | 335 | CLR A 336 | 337 | PDATALOOP: MOVX @R0,A 338 | 339 | INC R0 340 | 341 | DJNZ R7,PDATALOOP 342 | 343 | ENDIF 344 | 345 | 166 346 | 347 | 167 IF IBPSTACK <> 0 348 | 349 | EXTRN DATA (?C_IBP) 350 | 351 | 352 | 353 | MOV ?C_IBP,#LOW IBPSTACKTOP 354 | 355 | ENDIF 356 | 357 | 172 358 | 359 | 173 IF XBPSTACK <> 0 360 | 361 | EXTRN DATA (?C_XBP) 362 | 363 | 364 | 365 | MOV ?C_XBP,#HIGH XBPSTACKTOP 366 | 367 | MOV ?C_XBP+1,#LOW XBPSTACKTOP 368 | 369 | ENDIF 370 | 371 | 179 372 | 373 | 180 IF PBPSTACK <> 0 374 | 375 | EXTRN DATA (?C_PBP) 376 | 377 | MOV ?C_PBP,#LOW PBPSTACKTOP 378 | 379 | ENDIF 380 | 381 | 184 382 | 383 | 0006 758100 F 185 MOV SP,#?STACK-1 384 | 385 | 186 386 | 387 | 187 ; This code is required if you use L51_BANK.A51 with Banking Mode 4 388 | 389 | 188 ; Code Banking 390 | 391 | 189 ; Select Bank 0 for L51_BANK.A51 Mode 4 392 | 393 | A51 MACRO ASSEMBLER STARTUP 01/26/2021 18:03:16 PAGE 4 394 | 395 | 190 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 195 ; 406 | 407 | 0009 020000 F 196 LJMP ?C_START 408 | 409 | 197 410 | 411 | 198 END 412 | 413 | A51 MACRO ASSEMBLER STARTUP 01/26/2021 18:03:16 PAGE 5 414 | 415 | SYMBOL TABLE LISTING 416 | ------ ----- ------- 417 | 418 | 419 | N A M E T Y P E V A L U E ATTRIBUTES 420 | 421 | ?C_C51STARTUP. . . C SEG 000CH REL=UNIT 422 | ?C_START . . . . . C ADDR ----- EXT 423 | ?C_STARTUP . . . . C ADDR 0000H A 424 | ?STACK . . . . . . I SEG 0001H REL=UNIT 425 | ACC. . . . . . . . D ADDR 00E0H A 426 | B. . . . . . . . . D ADDR 00F0H A 427 | DPH. . . . . . . . D ADDR 0083H A 428 | DPL. . . . . . . . D ADDR 0082H A 429 | IBPSTACK . . . . . N NUMB 0000H A 430 | IBPSTACKTOP. . . . N NUMB 0100H A 431 | IDATALEN . . . . . N NUMB 0080H A 432 | IDATALOOP. . . . . C ADDR 0003H R SEG=?C_C51STARTUP 433 | PBPSTACK . . . . . N NUMB 0000H A 434 | PBPSTACKTOP. . . . N NUMB 0100H A 435 | PDATALEN . . . . . N NUMB 0000H A 436 | PDATASTART . . . . N NUMB 0000H A 437 | PPAGE. . . . . . . N NUMB 0000H A 438 | PPAGEENABLE. . . . N NUMB 0000H A 439 | PPAGE_SFR. . . . . D ADDR 00A0H A 440 | SP . . . . . . . . D ADDR 0081H A 441 | STARTUP1 . . . . . C ADDR 0000H R SEG=?C_C51STARTUP 442 | XBPSTACK . . . . . N NUMB 0000H A 443 | XBPSTACKTOP. . . . N NUMB 0000H A 444 | XDATALEN . . . . . N NUMB 0000H A 445 | XDATASTART . . . . N NUMB 0000H A 446 | 447 | 448 | REGISTER BANK(S) USED: 0 449 | 450 | 451 | ASSEMBLY COMPLETE. 0 WARNING(S), 0 ERROR(S) 452 | -------------------------------------------------------------------------------- /源代码/Listings/Terminal.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Listings/Terminal.lst -------------------------------------------------------------------------------- /源代码/Listings/adc.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Listings/adc.lst -------------------------------------------------------------------------------- /源代码/Listings/alarm.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Listings/alarm.lst -------------------------------------------------------------------------------- /源代码/Listings/eeprom.lst: -------------------------------------------------------------------------------- 1 | C51 COMPILER V9.56.0.0 EEPROM 01/01/2021 16:23:57 PAGE 1 2 | 3 | 4 | C51 COMPILER V9.56.0.0, COMPILATION OF MODULE EEPROM 5 | OBJECT MODULE PLACED IN .\Objects\eeprom.obj 6 | COMPILER INVOKED BY: C:\Keil_v5\C51\BIN\C51.EXE eeprom.c LARGE OPTIMIZE(0,SPEED) BROWSE DEBUG OBJECTEXTEND PRINT(.\Listi 7 | -ngs\eeprom.lst) TABS(2) OBJECT(.\Objects\eeprom.obj) 8 | 9 | line level source 10 | 11 | 1 #include "config.h" 12 | 2 13 | 3 14 | 4 15 | 5 uint8_t eeprom_read(uint16_t addr) 16 | 6 { 17 | 7 1 uint8_t result = 0; 18 | 8 1 int_iic_start(); 19 | 9 1 int_iic_write(0xA0); 20 | 10 1 int_iic_write(addr/0xff); 21 | 11 1 int_iic_write(addr%0xff); 22 | 12 1 23 | 13 1 int_iic_start(); 24 | 14 1 int_iic_write(0xA1); 25 | 15 1 result = int_iic_read(INTERNAL_IIC_NACK); 26 | 16 1 int_iic_stop(); 27 | 17 1 return result; 28 | 18 1 } 29 | 19 30 | 20 void eeprom_write(uint16_t addr, uint8_t dat) 31 | 21 { 32 | 22 1 int_iic_start(); 33 | 23 1 int_iic_write(0xA0); 34 | 24 1 int_iic_write(addr/0xff); 35 | 25 1 int_iic_write(addr%0xff); 36 | 26 1 int_iic_write(dat); 37 | 27 1 int_iic_stop(); 38 | 28 1 } 39 | 29 40 | 30 uint8_t command_eeprom_format(uint8_t argc, uint8_t argv [][COMMAND_MAX_ARG_LEN+1]) 41 | 31 { 42 | 32 1 uint16_t i; 43 | 33 1 uint8_t str[14]; 44 | 34 1 uint8_t j; 45 | 35 1 keep_screen_on=1; 46 | 36 1 terminal_add_bottom("Are You Sure?"); 47 | 37 1 left_key_pressed = right_key_pressed = 0; 48 | 38 1 ignore_next_key = 1; 49 | 39 1 while(left_key_pressed == 0 && right_key_pressed == 0); 50 | 40 1 51 | 41 1 if(left_key_pressed == 1) 52 | 42 1 { 53 | 43 2 left_key_pressed = right_key_pressed = 0; 54 | 44 2 terminal_add_bottom("Formatting..."); 55 | 45 2 terminal_add_bottom("Addr:0000"); 56 | 46 2 for(i = 0; i < 0x7fff; i += 64) 57 | 47 2 { 58 | 48 3 if((i & 0xff) == 0) 59 | 49 3 { 60 | 50 4 sprintf(str, "Addr:%4x", i); 61 | 51 4 terminal_modify(0, str); 62 | 52 4 } 63 | 53 3 int_iic_start(); 64 | 54 3 int_iic_write(0xA0); 65 | C51 COMPILER V9.56.0.0 EEPROM 01/01/2021 16:23:57 PAGE 2 66 | 67 | 55 3 int_iic_write(i>>8); 68 | 56 3 int_iic_write(i & 0xff); 69 | 57 3 for(j = 0; j != 64; ++j) 70 | 58 3 { 71 | 59 4 int_iic_write(0xff); 72 | 60 4 } 73 | 61 3 int_iic_stop(); 74 | 62 3 } 75 | 63 2 } 76 | 64 1 left_key_pressed = right_key_pressed = 0; 77 | 65 1 terminal_add_bottom("Done"); 78 | 66 1 keep_screen_on=0; 79 | 67 1 return COMMAND_OK; 80 | 68 1 } 81 | *** WARNING C280 IN LINE 30 OF eeprom.c: 'argc': unreferenced local variable 82 | *** WARNING C280 IN LINE 30 OF eeprom.c: 'argv': unreferenced local variable 83 | 84 | 85 | MODULE INFORMATION: STATIC OVERLAYABLE 86 | CODE SIZE = 470 ---- 87 | CONSTANT SIZE = 52 ---- 88 | XDATA SIZE = 27 ---- 89 | PDATA SIZE = ---- ---- 90 | DATA SIZE = ---- ---- 91 | IDATA SIZE = ---- ---- 92 | BIT SIZE = ---- ---- 93 | END OF MODULE INFORMATION. 94 | 95 | 96 | C51 COMPILATION COMPLETE. 2 WARNING(S), 0 ERROR(S) 97 | -------------------------------------------------------------------------------- /源代码/Listings/ext_iic.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Listings/ext_iic.lst -------------------------------------------------------------------------------- /源代码/Listings/flash.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Listings/flash.lst -------------------------------------------------------------------------------- /源代码/Listings/internal_iic.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Listings/internal_iic.lst -------------------------------------------------------------------------------- /源代码/Listings/main.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Listings/main.lst -------------------------------------------------------------------------------- /源代码/Listings/menu.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Listings/menu.lst -------------------------------------------------------------------------------- /源代码/Listings/menu_img.lst: -------------------------------------------------------------------------------- 1 | C51 COMPILER V9.56.0.0 MENU_IMG 01/11/2021 17:57:39 PAGE 1 2 | 3 | 4 | C51 COMPILER V9.56.0.0, COMPILATION OF MODULE MENU_IMG 5 | OBJECT MODULE PLACED IN .\Objects\menu_img.obj 6 | COMPILER INVOKED BY: C:\Keil_v5\C51\BIN\C51.EXE menu_img.c LARGE OPTIMIZE(9,SPEED) BROWSE DEBUG OBJECTEXTEND PRINT(.\Lis 7 | -tings\menu_img.lst) TABS(2) OBJECT(.\Objects\menu_img.obj) 8 | 9 | line level source 10 | 11 | 1 #include "config.h" 12 | 2 13 | 3 14 | 4 typedef void (*draw_f)(void); 15 | 5 typedef void (*display_f)(void); 16 | 6 17 | 7 // Function for buttons to call 18 | 8 // Return true to only call function once per press 19 | 9 // Return false to continually call function while the button is pressed 20 | 10 typedef bool (*button_f)(void); 21 | 11 22 | 12 typedef void (*menu_f)(void); 23 | 13 typedef void (*itemLoader_f)(uint8_t); 24 | 14 typedef enum 25 | 15 { 26 | 16 MENU_TYPE_STR, 27 | 17 MENU_TYPE_ICON 28 | 18 } menu_type_t; 29 | 19 30 | 20 typedef enum 31 | 21 { 32 | 22 OPERATION_DRAWICON, 33 | 23 OPERATION_DRAWNAME_ICON, 34 | 24 OPERATION_DRAWNAME_STR, 35 | 25 OPERATION_ACTION 36 | 26 } operation_t; 37 | 27 38 | 28 typedef struct 39 | 29 { 40 | 30 uint8_t dat; 41 | 31 operation_t op; 42 | 32 uint8_t id; 43 | 33 }operation_s; 44 | 34 45 | 35 typedef struct{ 46 | 36 menu_f btn1; // make array 47 | 37 menu_f btn2; 48 | 38 menu_f btn3; 49 | 39 draw_f draw; 50 | 40 itemLoader_f loader; 51 | 41 }menuFuncs_t; 52 | 42 53 | 43 typedef struct{ 54 | 44 uint8_t selected; 55 | 45 uint8_t scroll; 56 | 46 uint8_t optionCount; 57 | 47 bool isOpen; 58 | 48 const char* title; 59 | 49 menu_type_t menuType; 60 | 50 menuFuncs_t func; 61 | 51 menu_f prevMenu; 62 | 52 }menu_s; 63 | 53 64 | 54 typedef struct{ 65 | C51 COMPILER V9.56.0.0 MENU_IMG 01/11/2021 17:57:39 PAGE 2 66 | 67 | 55 uint8_t lastSelected; 68 | 56 menu_f last; 69 | 57 }prev_menu_s; 70 | 58 71 | 59 typedef struct{ 72 | 60 uint8_t now; 73 | 61 uint8_t val; 74 | 62 }s_menuNowSetting; 75 | 63 76 | 64 77 | 65 s_menuNowSetting setting; 78 | 66 menu_s menuData; 79 | 67 static operation_s operation; 80 | 68 uint8_t code menuBack[] = "BACK"; 81 | 69 82 | 70 static void doBtn(menu_f); 83 | 71 static void drawTitle(void); 84 | 72 static void loader(operation_t, uint8_t, uint8_t); 85 | 73 static void menu_drawStr(void); 86 | 74 static void menu_drawIcon(void); 87 | 75 static void checkScroll(void); 88 | 76 static void clear(void); 89 | 77 90 | 78 bool menu_select() 91 | 79 { 92 | 80 1 if(!menuData.isOpen) 93 | 81 1 { 94 | 82 2 menuData.isOpen = true; 95 | 83 2 mMainOpen(); 96 | *** WARNING C206 IN LINE 83 OF menu_img.c: 'mMainOpen': missing function-prototype 97 | 84 2 } 98 | 85 1 else if(menuData.func.btn2 != NULL) 99 | 86 1 menuData.func.btn2(); 100 | 87 1 return true; 101 | 88 1 } 102 | 89 103 | 90 bool menu_down() 104 | 91 { 105 | 92 1 doBtn(menuData.func.btn3); 106 | 93 1 return true; 107 | 94 1 } 108 | 95 109 | 96 bool menu_up() 110 | 97 { 111 | 98 1 doBtn(menuData.func.btn1); 112 | 99 1 return true; 113 | 100 1 } 114 | 101 115 | 102 static void doBtn(menu_f btn) 116 | 103 { 117 | 104 1 if(menuData.isOpen && (!animation_active() || animation_movingOn()) && btn != NULL) 118 | *** WARNING C206 IN LINE 104 OF menu_img.c: 'animation_active': missing function-prototype 119 | *** WARNING C206 IN LINE 104 OF menu_img.c: 'animation_movingOn': missing function-prototype 120 | 105 1 btn(); 121 | 106 1 } 122 | 107 123 | 108 display_t menu_draw() 124 | *** ERROR C129 IN LINE 108 OF menu_img.c: missing ';' before 'menu_draw' 125 | 109 { 126 | 110 display_t busy = DISPLAY_DONE; 127 | 111 if(menuData.menuType == MENU_TYPE_STR) 128 | 112 menu_drawStr(); 129 | C51 COMPILER V9.56.0.0 MENU_IMG 01/11/2021 17:57:39 PAGE 3 130 | 131 | 113 else 132 | 114 busy = menu_drawIcon(); 133 | 115 134 | 116 if(menuData.func.draw != NULL) 135 | 117 busy = busy || menuData.func.draw() ? DISPLAY_BUSY : DISPLAY_DONE; 136 | 118 137 | 119 return busy; 138 | 120 } 139 | 121 140 | 122 static void drawTitle() 141 | 123 { 142 | 124 char buff[BUFFSIZE_STR_MENU]; 143 | 125 memset(buff, ' ', sizeof(buff)); 144 | 126 strcpy_P(buff + (9 - (strlen_P(menuData.title) / 2)), menuData.title); 145 | 127 draw_string(buff, false, 0, 0); 146 | 128 } 147 | 129 148 | 130 static void loader(operation_t op, uint8_t num, uint8_t dat) 149 | 131 { 150 | 132 operation.op = op; 151 | 133 operation.id = num; 152 | 134 operation.dat = dat; 153 | 135 154 | 136 if(menuData.func.loader != NULL) 155 | 137 menuData.func.loader(num); 156 | 138 } 157 | 139 158 | 140 static void menu_drawStr() 159 | 141 { 160 | 142 drawTitle(); 161 | 143 162 | 144 uint8_t scroll = menuData.scroll; 163 | 145 uint8_t count = ((MAX_MENU_ITEMS < menuData.optionCount) ? MAX_MENU_ITEMS : menuData.optionCount) + scrol 164 | -l; 165 | 146 for(uint8_t i=scroll;i", false, 0, y); 170 | 151 loader(OPERATION_DRAWNAME_STR, i, y); 171 | 152 } 172 | 153 } 173 | 154 174 | 155 static display_t menu_drawIcon() 175 | 156 { 176 | 157 static int animX = 64; 177 | 158 178 | 159 int x = 64 - (48 * menuData.selected); 179 | 160 180 | 161 display_t busy = DISPLAY_DONE; 181 | 162 uint8_t speed; 182 | 163 if(x > animX) 183 | 164 { 184 | 165 speed = ((x - animX) / 4) + 1; 185 | 166 if(speed > 16) 186 | 167 speed = 16; 187 | 168 animX += speed; 188 | 169 if(x <= animX) 189 | 170 animX = x; 190 | 171 else 191 | 172 busy = DISPLAY_BUSY; 192 | 173 } 193 | C51 COMPILER V9.56.0.0 MENU_IMG 01/11/2021 17:57:39 PAGE 4 194 | 195 | 174 else if(x < animX) 196 | 175 { 197 | 176 speed = ((animX - x) / 4) + 1; 198 | 177 if(speed > 16) 199 | 178 speed = 16; 200 | 179 animX -= speed; 201 | 180 if(x >= animX) 202 | 181 animX = x; 203 | 182 else 204 | 183 busy = DISPLAY_BUSY; 205 | 184 } 206 | 185 207 | 186 x = animX - 16; 208 | 187 209 | 188 drawTitle(); 210 | 189 211 | 190 draw_bitmap(46, 14, selectbar_top, 36, 8, 0, 0); 212 | 191 draw_bitmap(46, 42, selectbar_bottom, 36, 8, 0, 0); 213 | 192 214 | 193 LOOP(menuData.optionCount, i) 215 | 194 { 216 | 195 if(x < FRAME_WIDTH && x > -32) 217 | 196 loader(OPERATION_DRAWICON, i, x); 218 | 197 x += 48; 219 | 198 } 220 | 199 221 | 200 loader(OPERATION_DRAWNAME_ICON, menuData.selected, 0); 222 | 201 223 | 202 return busy; 224 | 203 } 225 | 204 226 | 205 void setMenuOption_P(uint8_t num, const char* name, const uint8_t* icon, menu_f actionFunc) 227 | 206 { 228 | 207 if(num != operation.id) 229 | 208 return; 230 | 209 231 | 210 char buff[BUFFSIZE_STR_MENU]; 232 | 211 strcpy_P(buff, name); 233 | 212 setMenuOption(num, buff, icon, actionFunc); 234 | 213 } 235 | 214 236 | 215 #include 237 | 216 void setMenuOption(uint8_t num, const char* name, const uint8_t* icon, menu_f actionFunc) 238 | 217 { 239 | 218 if(num != operation.id) 240 | 219 return; 241 | 220 242 | 221 switch(operation.op) 243 | 222 { 244 | 223 case OPERATION_DRAWICON: 245 | 224 { 246 | 225 uint8_t a = operation.dat; 247 | 226 //if(a > FRAME_WIDTH) 248 | 227 // a -= (FRAME_WIDTH+32); 249 | 228 float x = ((a/(float)(FRAME_WIDTH-32)) * (M_PI / 2)) + (M_PI / 4); 250 | 229 uint8_t y = (sin(x) * 32); 251 | 230 y = 28; // comment this out for magic 252 | 231 253 | 232 draw_bitmap(operation.dat, y + 4 - 16, icon != NULL ? icon : menu_default, 32, 32, NOINVERT, 0); 254 | 233 } 255 | 234 break; 256 | 235 case OPERATION_DRAWNAME_ICON: 257 | C51 COMPILER V9.56.0.0 MENU_IMG 01/11/2021 17:57:39 PAGE 5 258 | 259 | 236 draw_string((char*)name, false, 0, FRAME_HEIGHT - 8); 260 | 237 break; 261 | 238 case OPERATION_DRAWNAME_STR: 262 | 239 draw_string((char*)name, false, 6, operation.dat); 263 | 240 break; 264 | 241 case OPERATION_ACTION: 265 | 242 if(actionFunc != NULL) 266 | 243 operation.dat ? beginAnimation(actionFunc) : actionFunc(); 267 | 244 break; 268 | 245 default: 269 | 246 break; 270 | 247 } 271 | 248 } 272 | 249 273 | 250 bool menu_isOpen() 274 | 251 { 275 | 252 return menuData.isOpen; 276 | 253 } 277 | 254 278 | 255 void menu_close() 279 | 256 { 280 | 257 clear(); 281 | 258 menuData.isOpen = false; 282 | 259 menuData.prevMenu = NULL; 283 | 260 display_load(); // Move somewhere else, sometimes we don't want to load the watch face when closing the m 284 | -enu 285 | 261 } 286 | 262 287 | 263 void setPrevMenuOpen(prev_menu_s* prevMenu, menu_f newPrevMenu) 288 | 264 { 289 | 265 if(menuData.prevMenu != newPrevMenu) // Make sure new and old menu funcs are not the same, otherwise we g 290 | -et stuck in a menu loop 291 | 266 prevMenu->last = menuData.prevMenu; // Save previous menu open func 292 | 267 menuData.selected = prevMenu->lastSelected; // 293 | 268 menuData.prevMenu = newPrevMenu; // Set new menu open func 294 | 269 } 295 | 270 296 | 271 void setPrevMenuExit(prev_menu_s* prevMenu) 297 | 272 { 298 | 273 if(!exitSelected()) // Opened new menu, save selected item 299 | 274 prevMenu->lastSelected = menuData.selected; 300 | 275 else 301 | 276 { 302 | 277 prevMenu->lastSelected = 0; // Reset selected item 303 | 278 menuData.prevMenu = prevMenu->last; // 304 | 279 } 305 | 280 } 306 | 281 307 | 282 bool exitSelected() 308 | 283 { 309 | 284 return menuData.selected == menuData.optionCount - 1; 310 | 285 } 311 | 286 312 | 287 static void clear() 313 | 288 { 314 | 289 memset(&menuData.func, 0, sizeof(menuFuncs_t)); 315 | 290 } 316 | 291 317 | 292 void addBackOption() 318 | 293 { 319 | 294 setMenuOption_P(menuData.optionCount - 1, menuBack, menu_exit, back); 320 | 295 } 321 | C51 COMPILER V9.56.0.0 MENU_IMG 01/11/2021 17:57:39 PAGE 6 322 | 323 | 296 324 | 297 void back() 325 | 298 { 326 | 299 menuData.prevMenu != NULL ? menuData.prevMenu() : mMainOpen(); 327 | 300 // mMainOpen(); 328 | 301 } 329 | 302 330 | 303 void beginAnimation(menu_f onComplete) 331 | 304 { 332 | 305 animation_start(onComplete, ANIM_MOVE_OFF); 333 | 306 } 334 | 307 335 | 308 void beginAnimation2(menu_f onComplete) 336 | 309 { 337 | 310 animation_start(onComplete, ANIM_MOVE_ON); 338 | 311 } 339 | 312 340 | 313 void setMenuInfo(uint8_t optionCount, menu_type_t menuType, const char* title) 341 | 314 { 342 | 315 clear(); 343 | 316 menuData.scroll = 0; 344 | 317 menuData.selected = 0; 345 | 318 menuData.optionCount = optionCount + 1; 346 | 319 menuData.menuType = menuType; 347 | 320 menuData.title = title; 348 | 321 } 349 | 322 350 | 323 void setMenuFuncs(menu_f btn1Func, menu_f btn2Func, menu_f btn3Func, itemLoader_f loader) 351 | 324 { 352 | 325 menuData.func.btn1 = btn1Func; 353 | 326 menuData.func.btn2 = btn2Func; 354 | 327 menuData.func.btn3 = btn3Func; 355 | 328 menuData.func.loader = loader; 356 | 329 } 357 | 330 358 | 331 void nextOption() 359 | 332 { 360 | 333 menuData.selected++; 361 | 334 if(menuData.selected >= menuData.optionCount) 362 | 335 menuData.selected = 0; 363 | 336 364 | 337 checkScroll(); 365 | 338 } 366 | 339 367 | 340 void prevOption() 368 | 341 { 369 | 342 menuData.selected--; 370 | 343 if(menuData.selected >= menuData.optionCount) 371 | 344 menuData.selected = menuData.optionCount - 1; 372 | 345 373 | 346 checkScroll(); 374 | 347 } 375 | 348 376 | 349 void doAction(bool anim) 377 | 350 { 378 | 351 loader(OPERATION_ACTION, menuData.selected, anim); 379 | 352 } 380 | 353 381 | 354 static void checkScroll() 382 | 355 { 383 | 356 uint8_t scroll = menuData.scroll; 384 | 357 if(menuData.selected >= scroll + MAX_MENU_ITEMS) 385 | C51 COMPILER V9.56.0.0 MENU_IMG 01/11/2021 17:57:39 PAGE 7 386 | 387 | 358 scroll = (menuData.selected + 1) - MAX_MENU_ITEMS; 388 | 359 else if(menuData.selected < scroll) 389 | 360 scroll = menuData.selected; 390 | 361 menuData.scroll = scroll; 391 | 362 } 392 | 393 | C51 COMPILATION COMPLETE. 3 WARNING(S), 1 ERROR(S) 394 | -------------------------------------------------------------------------------- /源代码/Listings/morse.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Listings/morse.lst -------------------------------------------------------------------------------- /源代码/Listings/mpu6050.lst: -------------------------------------------------------------------------------- 1 | C51 COMPILER V9.56.0.0 MPU6050 01/10/2021 21:14:17 PAGE 1 2 | 3 | 4 | C51 COMPILER V9.56.0.0, COMPILATION OF MODULE MPU6050 5 | OBJECT MODULE PLACED IN .\Objects\mpu6050.obj 6 | COMPILER INVOKED BY: C:\Keil_v5\C51\BIN\C51.EXE mpu6050.c LARGE OPTIMIZE(0,SPEED) BROWSE DEBUG OBJECTEXTEND PRINT(.\List 7 | -ings\mpu6050.lst) TABS(2) OBJECT(.\Objects\mpu6050.obj) 8 | 9 | line level source 10 | 11 | 1 #include "config.h" 12 | 2 13 | 3 14 | 4 15 | 5 int16_t mpu6050_x_zero=0, mpu6050_y_zero = 0, mpu6050_z_zero = 0; 16 | 6 17 | 7 int16_t mpu6050_getdata(uint8_t REG_Address) 18 | 8 { 19 | 9 1 uint8_t H,L; 20 | 10 1 int16_t adv = 0; 21 | 11 1 H=int_iic_read_addr(MPU6050_ADDR, REG_Address); 22 | 12 1 L=int_iic_read_addr(MPU6050_ADDR, REG_Address+1); 23 | 13 1 adv = (H<<8)+L; 24 | 14 1 return adv; 25 | 15 1 } 26 | 16 27 | 17 void mpu6050_init() 28 | 18 { 29 | 19 1 int_iic_write_addr(MPU6050_ADDR, PWR_MGMT_1, 0x00); //????????? 30 | 20 1 delay10ms(50); 31 | 21 1 int_iic_write_addr(MPU6050_ADDR, SMPLRT_DIV, 0x07); 32 | 22 1 int_iic_write_addr(MPU6050_ADDR, CONFIG, 0x00); 33 | 23 1 int_iic_write_addr(MPU6050_ADDR, GYRO_CONFIG, 0x18); 34 | 24 1 int_iic_write_addr(MPU6050_ADDR, ACCEL_CONFIG, 0x00); 35 | 25 1 // int_iic_write_addr(MPU6050_ADDR, 0X37, 0x9c); 36 | 26 1 // int_iic_write_addr(MPU6050_ADDR, 0X38, 0X40); 37 | 27 1 // int_iic_write_addr(MPU6050_ADDR, 0X1F, 0XEA); 38 | 28 1 // int_iic_write_addr(MPU6050_ADDR, 0X69, 0X30); 39 | 29 1 // int_iic_write_addr(MPU6050_ADDR, 0X20, 0X01); 40 | 30 1 // int_iic_write_addr(MPU6050_ADDR, 0X6C, 0XC0); 41 | 31 1 } 42 | 32 43 | 33 void mpu6050_zero() 44 | 34 { 45 | 35 1 46 | 36 1 } 47 | 37 48 | 38 49 | 39 uint8_t command_mpu6050(COMMAND_ARGS) 50 | 40 { 51 | 41 1 uint8_t addr = ACCEL_XOUT_H; 52 | 42 1 mpu6050_init(); 53 | 43 1 oled_stop_refresh(); 54 | 44 1 graph_init(); 55 | 45 1 graph_move_axis(127); 56 | 46 1 keep_screen_on = 1; 57 | 47 1 while(1) 58 | 48 1 { 59 | 49 2 delay10ms(10); 60 | 50 2 graph_add_num((float)mpu6050_getdata(addr)/2000); 61 | 51 2 if(KEY_DOWN == 0) 62 | 52 2 { 63 | 53 3 ignore_next_key = 1; 64 | 54 3 while(KEY_DOWN == 0); 65 | C51 COMPILER V9.56.0.0 MPU6050 01/10/2021 21:14:17 PAGE 2 66 | 67 | 55 3 delay10ms(1); 68 | 56 3 keyClear(); 69 | 57 3 while(1) 70 | 58 3 { 71 | 59 4 if(keyUp.pressed) 72 | 60 4 { 73 | 61 5 keyUp.pressed = 0; 74 | 62 5 graph_move_axis(-1); 75 | 63 5 } 76 | 64 4 else if(keyUp.longpressed) 77 | 65 4 { 78 | 66 5 keyUp.longpressed = 0; 79 | 67 5 addr += 2; 80 | 68 5 if(addr >= 0x4a) addr = ACCEL_XOUT_H; 81 | 69 5 sprintf(oled_tmpstr, "addr:0x%bx", addr); 82 | 70 5 oled_draw_6x8(10,1,oled_tmpstr); 83 | 71 5 oled_send_buffer(); 84 | 72 5 delay10ms(100); 85 | 73 5 break; 86 | 74 5 } 87 | 75 4 88 | 76 4 if(keyDown.pressed) 89 | 77 4 { 90 | 78 5 keyDown.pressed = 0; 91 | 79 5 graph_move_axis(1); 92 | 80 5 } 93 | 81 4 else if(keyDown.longpressed) 94 | 82 4 { 95 | 83 5 keyDown.longpressed = 0; 96 | 84 5 goto end; 97 | 85 5 } 98 | 86 4 } 99 | 87 3 } 100 | 88 2 } 101 | 89 1 end: 102 | 90 1 //keyClear(); 103 | 91 1 keep_screen_on = 0; 104 | 92 1 oled_start_refresh(); 105 | 93 1 return COMMAND_OK; 106 | 94 1 } 107 | *** WARNING C280 IN LINE 39 OF mpu6050.c: 'argc': unreferenced local variable 108 | *** WARNING C280 IN LINE 39 OF mpu6050.c: 'argv': unreferenced local variable 109 | 110 | 111 | MODULE INFORMATION: STATIC OVERLAYABLE 112 | CODE SIZE = 432 ---- 113 | CONSTANT SIZE = 11 ---- 114 | XDATA SIZE = 16 ---- 115 | PDATA SIZE = ---- ---- 116 | DATA SIZE = ---- ---- 117 | IDATA SIZE = ---- ---- 118 | BIT SIZE = ---- ---- 119 | END OF MODULE INFORMATION. 120 | 121 | 122 | C51 COMPILATION COMPLETE. 2 WARNING(S), 0 ERROR(S) 123 | -------------------------------------------------------------------------------- /源代码/Listings/music.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Listings/music.lst -------------------------------------------------------------------------------- /源代码/Listings/oled.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Listings/oled.lst -------------------------------------------------------------------------------- /源代码/Listings/rtc.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Listings/rtc.lst -------------------------------------------------------------------------------- /源代码/Listings/serial.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Listings/serial.lst -------------------------------------------------------------------------------- /源代码/Listings/settings.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Listings/settings.lst -------------------------------------------------------------------------------- /源代码/Objects/Conf_tny.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/Conf_tny.obj -------------------------------------------------------------------------------- /源代码/Objects/ExtDll.iex: -------------------------------------------------------------------------------- 1 | [EXTDLL] 2 | Count=0 3 | -------------------------------------------------------------------------------- /源代码/Objects/Graph.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/Graph.obj -------------------------------------------------------------------------------- /源代码/Objects/STARTUP.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/STARTUP.obj -------------------------------------------------------------------------------- /源代码/Objects/Terminal.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/Terminal.obj -------------------------------------------------------------------------------- /源代码/Objects/adc.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/adc.obj -------------------------------------------------------------------------------- /源代码/Objects/alarm.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/alarm.obj -------------------------------------------------------------------------------- /源代码/Objects/eeprom.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/eeprom.obj -------------------------------------------------------------------------------- /源代码/Objects/ext_iic.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/ext_iic.obj -------------------------------------------------------------------------------- /源代码/Objects/flash.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/flash.obj -------------------------------------------------------------------------------- /源代码/Objects/internal_iic.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/internal_iic.obj -------------------------------------------------------------------------------- /源代码/Objects/main.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/main.obj -------------------------------------------------------------------------------- /源代码/Objects/menu.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/menu.obj -------------------------------------------------------------------------------- /源代码/Objects/morse.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/morse.obj -------------------------------------------------------------------------------- /源代码/Objects/mpu6050.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/mpu6050.obj -------------------------------------------------------------------------------- /源代码/Objects/music.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/music.obj -------------------------------------------------------------------------------- /源代码/Objects/oled.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/oled.obj -------------------------------------------------------------------------------- /源代码/Objects/rtc.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/rtc.obj -------------------------------------------------------------------------------- /源代码/Objects/serial.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/serial.obj -------------------------------------------------------------------------------- /源代码/Objects/settings.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/settings.obj -------------------------------------------------------------------------------- /源代码/Objects/watch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/watch -------------------------------------------------------------------------------- /源代码/Objects/watch.ORC: -------------------------------------------------------------------------------- 1 | F7FF ALARM_RW_EEPROM_NUM 2 | F78F DATE_COUNTDOWN 3 | E301 DELAY5US 4 | E300 EXT_IIC_INIT 5 | E301 EXT_IIC_READ 6 | E301 EXT_IIC_RECV_ACK 7 | E301 EXT_IIC_SEND_ACK 8 | E301 EXT_IIC_SEND_NAK 9 | E301 EXT_IIC_START 10 | E301 EXT_IIC_STOP 11 | E301 EXT_IIC_WAIT 12 | 8000 HANDLENOTFOUND 13 | 8000 HANDLESTROVERFLOW 14 | FF8F INT0_ISR 15 | FF8F INT1_ISR 16 | E301 INT_IIC_START 17 | E301 INT_IIC_STOP 18 | 8000 MPU6050_ZERO 19 | F303 OLED_CLEAR_BUFFER 20 | F701 OLED_CLEAR_SPIRITS 21 | F301 OLED_INIT 22 | F703 OLED_SEND_BUFFER 23 | E301 POWEROFF 24 | F315 RTC_CLEAR_ALARM_FLAG 25 | F78F SETTINGS_LOAD 26 | F78F SETTINGS_SAVE 27 | F701 TERMINAL_INIT 28 | C000 TIMER0INIT 29 | C000 TIMER1INIT 30 | FF8F UART1_ISR 31 | C000 UARTINIT 32 | F7FF _ALARM_FINDNEXT 33 | F7FF _ALARM_READ_EEPROM 34 | F7FF _ALARM_WRITE_EEPROM 35 | F703 _BCD_TO_DEC 36 | E301 _COMMAND_ENABLE_SERIAL 37 | F7F7 _COMMAND_IIC_WRITE 38 | F7F7 _COMMAND_IIC_WRITE16 39 | F7FF _COMMAND_SET_COUNTDOWN 40 | F703 _DEC_TO_BCD 41 | F783 _DELAY 42 | F78F _EEPROM_READ 43 | F78F _EEPROM_WRITE 44 | E301 _EXT_IIC_READ_ADDR 45 | E301 _EXT_IIC_WRITE 46 | E301 _EXT_IIC_WRITE_ADDR 47 | E30F _GETADC 48 | F3F1 _GETHEX8 49 | F7FF _GETINT 50 | F301 _INT_IIC_CHECK_DEVICE 51 | F303 _INT_IIC_READ 52 | F303 _INT_IIC_READ_ADDR 53 | F301 _INT_IIC_WRITE 54 | F301 _INT_IIC_WRITE_ADDR 55 | F7F1 _ISINT 56 | F38F _MAX 57 | F38F _MIN 58 | F30F _MPU6050_GETDATA 59 | F787 _OLED_DRAWHLINE 60 | F78F _OLED_DRAWVLINE 61 | F7F3 _OLED_DRAW_6X8 62 | F783 _OLED_DRAW_DOT 63 | F79F _OLED_DRAW_LINE 64 | A301 _OLED_ENABLE_INVERSE 65 | A301 _OLED_INVERSE 66 | F701 _OLED_REMOVE_SPIRIT 67 | F7F7 _OLED_SPIRIT_CHANGE_STR_6X8 68 | F701 _OLED_SPIRIT_GET_HEIGHT 69 | F701 _OLED_SPIRIT_GET_WIDTH 70 | F703 _OLED_SPIRIT_MOVE_ALL_DOWN 71 | F703 _OLED_SPIRIT_MOVE_ALL_UP 72 | F703 _OLED_SPIRIT_MOVE_DIRECT 73 | E301 _OLED_WR_CMD 74 | E301 _OLED_WR_DAT 75 | F301 _RTC_ENABLE_ALARM 76 | F317 _RTC_OFFSET 77 | F7FF _RTC_READ_TIME 78 | F7FF _RTC_SET_ALARM 79 | F7F3 _RTC_SET_TIME 80 | F7FF _SET_ALARM 81 | F7F7 _TERMINAL_ADD_BOTTOM 82 | F78F _TERMINAL_ADD_CHR 83 | F7F7 _TERMINAL_ADD_TOP 84 | F703 _TERMINAL_GET_ARR 85 | F7F7 _TERMINAL_MODIFY 86 | F7F1 _TIME_TO_STR 87 | -------------------------------------------------------------------------------- /源代码/Objects/watch.build_log.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Objects/watch.build_log.htm -------------------------------------------------------------------------------- /源代码/Objects/watch.lnp: -------------------------------------------------------------------------------- 1 | ".\Objects\STARTUP.obj", 2 | ".\Objects\flash.obj", 3 | ".\Objects\main.obj", 4 | ".\Objects\oled.obj", 5 | ".\Objects\rtc.obj", 6 | ".\Objects\internal_iic.obj", 7 | ".\Objects\adc.obj", 8 | ".\Objects\Terminal.obj", 9 | ".\Objects\morse.obj", 10 | ".\Objects\alarm.obj", 11 | ".\Objects\settings.obj", 12 | ".\Objects\music.obj", 13 | ".\Objects\menu.obj", 14 | ".\Objects\serial.obj" 15 | TO ".\Objects\watch" 16 | PRINT(".\Listings\watch.m51") RAMSIZE(256) 17 | CODE( 0X0000-0XFFF8 ) 18 | XDATA( 0X0000-0X1FFF ) 19 | -------------------------------------------------------------------------------- /源代码/STARTUP.A51: -------------------------------------------------------------------------------- 1 | $NOMOD51 2 | ;------------------------------------------------------------------------------ 3 | ; This file is part of the C51 Compiler package 4 | ; Copyright (c) 1988-2005 Keil Elektronik GmbH and Keil Software, Inc. 5 | ; Version 8.01 6 | ; 7 | ; *** <<< Use Configuration Wizard in Context Menu >>> *** 8 | ;------------------------------------------------------------------------------ 9 | ; STARTUP.A51: This code is executed after processor reset. 10 | ; 11 | ; To translate this file use A51 with the following invocation: 12 | ; 13 | ; A51 STARTUP.A51 14 | ; 15 | ; To link the modified STARTUP.OBJ file to your application use the following 16 | ; Lx51 invocation: 17 | ; 18 | ; Lx51 your object file list, STARTUP.OBJ controls 19 | ; 20 | ;------------------------------------------------------------------------------ 21 | ; 22 | ; User-defined Power-On Initialization of Memory 23 | ; 24 | ; With the following EQU statements the initialization of memory 25 | ; at processor reset can be defined: 26 | ; 27 | ; IDATALEN: IDATA memory size <0x0-0x100> 28 | ; Note: The absolute start-address of IDATA memory is always 0 29 | ; The IDATA space overlaps physically the DATA and BIT areas. 30 | IDATALEN EQU 80H 31 | ; 32 | ; XDATASTART: XDATA memory start address <0x0-0xFFFF> 33 | ; The absolute start address of XDATA memory 34 | XDATASTART EQU 0 35 | ; 36 | ; XDATALEN: XDATA memory size <0x0-0xFFFF> 37 | ; The length of XDATA memory in bytes. 38 | XDATALEN EQU 0 39 | ; 40 | ; PDATASTART: PDATA memory start address <0x0-0xFFFF> 41 | ; The absolute start address of PDATA memory 42 | PDATASTART EQU 0H 43 | ; 44 | ; PDATALEN: PDATA memory size <0x0-0xFF> 45 | ; The length of PDATA memory in bytes. 46 | PDATALEN EQU 0H 47 | ; 48 | ; 49 | ;------------------------------------------------------------------------------ 50 | ; 51 | ; Reentrant Stack Initialization 52 | ; 53 | ; The following EQU statements define the stack pointer for reentrant 54 | ; functions and initialized it: 55 | ; 56 | ; Stack Space for reentrant functions in the SMALL model. 57 | ; IBPSTACK: Enable SMALL model reentrant stack 58 | ; Stack space for reentrant functions in the SMALL model. 59 | IBPSTACK EQU 0 ; set to 1 if small reentrant is used. 60 | ; IBPSTACKTOP: End address of SMALL model stack <0x0-0xFF> 61 | ; Set the top of the stack to the highest location. 62 | IBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1 63 | ; 64 | ; 65 | ; Stack Space for reentrant functions in the LARGE model. 66 | ; XBPSTACK: Enable LARGE model reentrant stack 67 | ; Stack space for reentrant functions in the LARGE model. 68 | XBPSTACK EQU 0 ; set to 1 if large reentrant is used. 69 | ; XBPSTACKTOP: End address of LARGE model stack <0x0-0xFFFF> 70 | ; Set the top of the stack to the highest location. 71 | XBPSTACKTOP EQU 0xFFFF +1 ; default 0FFFFH+1 72 | ; 73 | ; 74 | ; Stack Space for reentrant functions in the COMPACT model. 75 | ; PBPSTACK: Enable COMPACT model reentrant stack 76 | ; Stack space for reentrant functions in the COMPACT model. 77 | PBPSTACK EQU 0 ; set to 1 if compact reentrant is used. 78 | ; 79 | ; PBPSTACKTOP: End address of COMPACT model stack <0x0-0xFFFF> 80 | ; Set the top of the stack to the highest location. 81 | PBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1 82 | ; 83 | ; 84 | ;------------------------------------------------------------------------------ 85 | ; 86 | ; Memory Page for Using the Compact Model with 64 KByte xdata RAM 87 | ; Compact Model Page Definition 88 | ; 89 | ; Define the XDATA page used for PDATA variables. 90 | ; PPAGE must conform with the PPAGE set in the linker invocation. 91 | ; 92 | ; Enable pdata memory page initalization 93 | PPAGEENABLE EQU 0 ; set to 1 if pdata object are used. 94 | ; 95 | ; PPAGE number <0x0-0xFF> 96 | ; uppermost 256-byte address of the page used for PDATA variables. 97 | PPAGE EQU 0 98 | ; 99 | ; SFR address which supplies uppermost address byte <0x0-0xFF> 100 | ; most 8051 variants use P2 as uppermost address byte 101 | PPAGE_SFR DATA 0A0H 102 | ; 103 | ; 104 | ;------------------------------------------------------------------------------ 105 | 106 | ; Standard SFR Symbols 107 | ACC DATA 0E0H 108 | B DATA 0F0H 109 | SP DATA 81H 110 | DPL DATA 82H 111 | DPH DATA 83H 112 | 113 | NAME ?C_STARTUP 114 | 115 | 116 | ?C_C51STARTUP SEGMENT CODE 117 | ?STACK SEGMENT IDATA 118 | 119 | RSEG ?STACK 120 | DS 1 121 | 122 | EXTRN CODE (?C_START) 123 | PUBLIC ?C_STARTUP 124 | 125 | CSEG AT 0 126 | ?C_STARTUP: LJMP STARTUP1 127 | 128 | RSEG ?C_C51STARTUP 129 | 130 | STARTUP1: 131 | 132 | IF IDATALEN <> 0 133 | MOV R0,#IDATALEN - 1 134 | CLR A 135 | IDATALOOP: MOV @R0,A 136 | DJNZ R0,IDATALOOP 137 | ENDIF 138 | 139 | IF XDATALEN <> 0 140 | MOV DPTR,#XDATASTART 141 | MOV R7,#LOW (XDATALEN) 142 | IF (LOW (XDATALEN)) <> 0 143 | MOV R6,#(HIGH (XDATALEN)) +1 144 | ELSE 145 | MOV R6,#HIGH (XDATALEN) 146 | ENDIF 147 | CLR A 148 | XDATALOOP: MOVX @DPTR,A 149 | INC DPTR 150 | DJNZ R7,XDATALOOP 151 | DJNZ R6,XDATALOOP 152 | ENDIF 153 | 154 | IF PPAGEENABLE <> 0 155 | MOV PPAGE_SFR,#PPAGE 156 | ENDIF 157 | 158 | IF PDATALEN <> 0 159 | MOV R0,#LOW (PDATASTART) 160 | MOV R7,#LOW (PDATALEN) 161 | CLR A 162 | PDATALOOP: MOVX @R0,A 163 | INC R0 164 | DJNZ R7,PDATALOOP 165 | ENDIF 166 | 167 | IF IBPSTACK <> 0 168 | EXTRN DATA (?C_IBP) 169 | 170 | MOV ?C_IBP,#LOW IBPSTACKTOP 171 | ENDIF 172 | 173 | IF XBPSTACK <> 0 174 | EXTRN DATA (?C_XBP) 175 | 176 | MOV ?C_XBP,#HIGH XBPSTACKTOP 177 | MOV ?C_XBP+1,#LOW XBPSTACKTOP 178 | ENDIF 179 | 180 | IF PBPSTACK <> 0 181 | EXTRN DATA (?C_PBP) 182 | MOV ?C_PBP,#LOW PBPSTACKTOP 183 | ENDIF 184 | 185 | MOV SP,#?STACK-1 186 | 187 | ; This code is required if you use L51_BANK.A51 with Banking Mode 4 188 | ; Code Banking 189 | ; Select Bank 0 for L51_BANK.A51 Mode 4 190 | #if 0 191 | ; Initialize bank mechanism to code bank 0 when using L51_BANK.A51 with Banking Mode 4. 192 | EXTRN CODE (?B_SWITCH0) 193 | CALL ?B_SWITCH0 ; init bank mechanism to code bank 0 194 | #endif 195 | ; 196 | LJMP ?C_START 197 | 198 | END 199 | -------------------------------------------------------------------------------- /源代码/Terminal.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/Terminal.c -------------------------------------------------------------------------------- /源代码/Terminal.h: -------------------------------------------------------------------------------- 1 | #ifndef __TERMINAL_H__ 2 | #define __TERMINAL_H__ 3 | 4 | uint8_t command_print(uint8_t argc, uint8_t argv [][COMMAND_MAX_ARG_LEN+1]); 5 | 6 | 7 | uint8_t terminal_get_arr(uint8_t num); 8 | void terminal_init(); 9 | void terminal_set_big_font(bit en); 10 | void terminal_set_lines(uint8_t lines); 11 | void terminal_add_top(uint8_t *str); 12 | void terminal_add_bottom(uint8_t *str); 13 | void terminal_modify(uint8_t line, uint8_t *str); 14 | uint8_t proc_command(uint8_t *command); 15 | void terminal_add_chr(uint8_t chr); 16 | void TerminalMode(); 17 | uint8_t command_enable_serial(COMMAND_ARGS); 18 | 19 | uint8_t isint(uint8_t *str); 20 | int16_t getint(uint8_t *str); 21 | uint8_t gethex8(uint8_t *str); 22 | 23 | #endif -------------------------------------------------------------------------------- /源代码/adc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/adc.c -------------------------------------------------------------------------------- /源代码/adc.h: -------------------------------------------------------------------------------- 1 | #ifndef __ADC_H__ 2 | #define __ADC_H__ 3 | 4 | 5 | uint16_t adc_get_voltage(uint8_t channel); 6 | void ADCUpdate(); 7 | 8 | 9 | #endif -------------------------------------------------------------------------------- /源代码/alarm.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/alarm.c -------------------------------------------------------------------------------- /源代码/alarm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/alarm.h -------------------------------------------------------------------------------- /源代码/config.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/config.h -------------------------------------------------------------------------------- /源代码/flash.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/flash.c -------------------------------------------------------------------------------- /源代码/flash.h: -------------------------------------------------------------------------------- 1 | #ifndef __FLASH_H__ 2 | #define __FLASH_H__ 3 | 4 | 5 | void flash_init(); 6 | bit flash_chk_busy(); 7 | void flash_chip_erase(); 8 | void flash_read(uint32_t addr, uint32_t size, uint8_t *buffer); 9 | void flash_write(uint32_t addr, uint32_t size, uint8_t *buffer); 10 | void flash_erase_sector(uint32_t addr); 11 | uint8_t command_flash_program(COMMAND_ARGS); 12 | 13 | #endif -------------------------------------------------------------------------------- /源代码/internal_iic.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/internal_iic.c -------------------------------------------------------------------------------- /源代码/internal_iic.h: -------------------------------------------------------------------------------- 1 | #ifndef __INTERNAL_IIC_H__ 2 | #define __INTERNAL_IIC_H__ 3 | 4 | #define INTERNAL_IIC_ACK 0 5 | #define INTERNAL_IIC_NACK 1 6 | 7 | 8 | void int_iic_start(); /* --------- Initiate int_iic_start condition ---------- */ 9 | void int_iic_stop(); /* ---------- Initiate int_iic_stop condition ----------- */ 10 | uint8_t int_iic_write(uint8_t d); /* ----------------------------- */ 11 | uint8_t int_iic_read(uint8_t ack); /* ----------------------------------- */ 12 | uint8_t int_iic_read_addr(uint8_t devaddr, uint8_t addr); 13 | void int_iic_write_addr(uint8_t devaddr, uint8_t addr, uint8_t dat); 14 | uint8_t int_iic_check_device(uint8_t addr); 15 | uint8_t command_iic_check(COMMAND_ARGS); 16 | uint8_t command_iic_read(COMMAND_ARGS); 17 | uint8_t command_iic_write(COMMAND_ARGS); 18 | uint8_t command_iic_read16(COMMAND_ARGS); 19 | uint8_t command_iic_write16(COMMAND_ARGS); 20 | 21 | 22 | #endif -------------------------------------------------------------------------------- /源代码/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/main.c -------------------------------------------------------------------------------- /源代码/menu.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/menu.c -------------------------------------------------------------------------------- /源代码/menu.h: -------------------------------------------------------------------------------- 1 | #ifndef __MENU_H__ 2 | #define __MENU_H__ 3 | 4 | 5 | 6 | extern void menu_init(); 7 | extern uint16_t menu_start(uint8_t *title); 8 | extern void menu_add(uint8_t *str); 9 | extern void menu_roll(bit direction); 10 | extern void menu_end(); 11 | extern void menu_inverse_refresh(); 12 | 13 | uint8_t menu_ask_yn(uint8_t *tip); 14 | uint8_t menu_ask_num(uint8_t start, uint8_t end, uint8_t *tip); 15 | void pop_msg(uint8_t *tip); 16 | void req_password(); 17 | 18 | 19 | #endif -------------------------------------------------------------------------------- /源代码/morse.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/morse.c -------------------------------------------------------------------------------- /源代码/morse.h: -------------------------------------------------------------------------------- 1 | #ifndef __MORSE_H__ 2 | #define __MORSE_H__ 3 | 4 | #define MORSE_TOTAL 36 5 | #define MAX_INPUT_STR 50 6 | #define MAX_INPUT_CHR 6 7 | #define DA_TIME 20 8 | #define CHR_TIME 40 9 | #define LONG_TIME KEY_LONG_PRESS_TIME 10 | #define SPACE_TIME 200 11 | extern unsigned char morse_input_str[MAX_INPUT_STR]; 12 | extern uint8_t strPointer; 13 | void morseUpdate(); 14 | #endif -------------------------------------------------------------------------------- /源代码/music.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/music.c -------------------------------------------------------------------------------- /源代码/music.h: -------------------------------------------------------------------------------- 1 | #ifndef __MUSIC_H__ 2 | #define __MUSIC_H__ 3 | 4 | #define SOUND_TIP_FREQ 2000 5 | #define SOUND_ERROR_FREQ 400 6 | void alert(); 7 | void beep(uint16_t freq); 8 | uint8_t command_mario(COMMAND_ARGS); 9 | 10 | #endif -------------------------------------------------------------------------------- /源代码/oled.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/oled.c -------------------------------------------------------------------------------- /源代码/oled.h: -------------------------------------------------------------------------------- 1 | #ifndef __OLED_H__ 2 | #define __OLED_H__ 3 | 4 | #define OLED_MAX_SPIRITS 9 5 | #define OLED_ANIMATION_SPEED 2 6 | #define OLED_X_MAX 128 7 | #define OLED_Y_MAX 64 8 | 9 | #define oled_stop_refresh() TR1=0 10 | #define oled_start_refresh() TR1=1 11 | 12 | 13 | typedef struct{ 14 | uint8_t enable; 15 | uint8_t buffer[256]; 16 | int8_t x; 17 | int8_t y; 18 | int8_t now_x; 19 | int8_t now_y; 20 | int8_t w; 21 | int8_t h; 22 | uint8_t gooff; 23 | uint8_t speed; 24 | } struct_oled_sprite; 25 | 26 | typedef struct{ 27 | uint8_t enable; 28 | int8_t x; 29 | int8_t y; 30 | int8_t x_end; 31 | int8_t y_end; 32 | int8_t now_x; 33 | int8_t now_y; 34 | int8_t now_x_end; 35 | int8_t now_y_end; 36 | } struct_oled_inverse; 37 | 38 | 39 | int16_t max(int16_t a ,int16_t b); 40 | int16_t min(int16_t a ,int16_t b); 41 | void oled_wr_cmd(uint8_t cmd); 42 | void oled_wr_dat(uint8_t dat); 43 | void oled_send_buffer(); 44 | void oled_clear_buffer(); 45 | void oled_init_sprites(); 46 | void oled_clear_sprites(); 47 | void oled_remove_sprite(uint8_t num); 48 | void oled_init(); //Initial_M096128x64_ssd1306 49 | 50 | int8_t oled_sprite_find(); 51 | int8_t oled_sprite_change_6x8(uint8_t sprite_num, int8_t x, int8_t y, uint8_t str[]); 52 | void oled_inverse(int8_t x, int8_t y, int8_t x_end, int8_t y_end); 53 | void oled_enable_inverse(uint8_t enable); 54 | void oled_proc_sprites(); 55 | 56 | uint8_t oled_sprite_get_height(uint8_t num); 57 | uint8_t oled_sprite_get_width(uint8_t num); 58 | void oled_sprite_move(uint8_t num, int8_t x, int8_t y); 59 | void oled_sprite_move_direct(uint8_t num, int8_t x, int8_t y); 60 | void oled_sprite_move_all_up(uint8_t distance); 61 | void oled_sprite_move_all_down(uint8_t distance); 62 | void oled_sprite_change_str_6x8(uint8_t num, uint8_t* str); 63 | void oled_sprite_change_pic(uint8_t sprite_num, int8_t x, int8_t y, uint8_t w, uint8_t h, uint8_t *dat); 64 | //////////////////////////////////////////////////// 65 | void oled_draw_6x8(uint8_t x, uint8_t page, uint8_t* str); 66 | void oled_draw_dot(uint8_t x, uint8_t y); 67 | void oled_drawvline(uint8_t x, uint8_t y_start, uint8_t y_end); 68 | void oled_drawhline(uint8_t x0, uint8_t x1, uint8_t y); 69 | void oled_draw_line(unsigned char x0 , unsigned char y0 , unsigned char x1 , unsigned char y1); 70 | void oled_fill_rect(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2); 71 | ///////////////////////////////////////////////////////////// 72 | bit has_gb2312(uint8_t *str); 73 | void oled_sprite_change_gb2312(uint8_t num, int8_t x, int8_t y, uint8_t *str); 74 | void oled_sprite_change_str_gb2312(uint8_t num, uint8_t *str); 75 | void oled_draw_bitmap_fast(uint8_t x, uint8_t yy, uint8_t* bitmap, uint8_t w, uint8_t h, uint8_t invert, uint8_t offsetY); 76 | /////////////////////////////////////////////////////////////// 77 | extern uint8_t oled_tmpstr[50]; 78 | extern uint8_t code oled_font_64x32[]; 79 | #endif -------------------------------------------------------------------------------- /源代码/rtc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/rtc.c -------------------------------------------------------------------------------- /源代码/rtc.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTC_H__ 2 | #define __RTC_H__ 3 | #define RTC_IIC_ADDRESS 0xD0 4 | typedef struct 5 | { 6 | uint8_t second; 7 | uint8_t minute; 8 | uint8_t hour; 9 | uint8_t day; 10 | uint8_t date; 11 | uint8_t month; 12 | uint8_t year; 13 | uint16_t minute_of_day; 14 | }struct_time; 15 | 16 | extern struct_time current_time; 17 | extern uint8_t * code week_arr[7]; 18 | 19 | uint8_t dec_to_bcd(uint8_t dec); 20 | uint8_t bcd_to_dec(uint8_t bcd); 21 | void delay(uint16_t ms); //@24.000MHz 22 | void TimeUpdate(); 23 | void rtc_reset(); 24 | void rtc_read_time(struct_time *tm); 25 | void rtc_set_time(struct_time *tm); 26 | void TimeMode(); 27 | 28 | void alert_countdown(); 29 | uint8_t command_set_deadline(COMMAND_ARGS); 30 | #endif -------------------------------------------------------------------------------- /源代码/serial.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/serial.c -------------------------------------------------------------------------------- /源代码/serial.h: -------------------------------------------------------------------------------- 1 | #ifndef __SERIAL_H__ 2 | #define __SERIAL_H__ 3 | 4 | void serial_init(); //960bps@24.000MHz 5 | void serial_set_timeout(uint16_t _timeout); 6 | void serial2_send(char dat); 7 | char serial2_read(); 8 | void serial1_sendstr(uint8_t *str); 9 | void serial2_sendstr(uint8_t *str); 10 | bit serial1_getdata(uint8_t *buffer, uint16_t size); 11 | bit serial2_getdata(uint8_t *buffer, uint16_t size); 12 | void rf_set_rfid(uint16_t rfid); 13 | void rf_set_dvid(uint16_t dvid); 14 | void rf_set_channel(int8_t channel); 15 | void rf_set_power(uint8_t power); 16 | void rf_enable(bit enable); 17 | #define rf_send(chr) serial2_sendstr(chr) 18 | #define rf_read() serial2_read() 19 | #define rf_sendstr(str) serial2_sendstr(str) 20 | #define rf_getdata(buffer,size) serial2_getdata(buffer,size) 21 | 22 | 23 | #endif -------------------------------------------------------------------------------- /源代码/settings.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/源代码/settings.c -------------------------------------------------------------------------------- /源代码/settings.h: -------------------------------------------------------------------------------- 1 | #ifndef __SETTINGS_H__ 2 | #define __SETTINGS_H__ 3 | 4 | 5 | typedef struct 6 | { 7 | uint8_t empty; 8 | uint8_t stop_year; 9 | uint8_t stop_month; 10 | uint8_t stop_date; 11 | uint8_t enable_alert; 12 | uint8_t volume; 13 | }setting_t; 14 | 15 | extern setting_t settings; 16 | 17 | void settings_load(); 18 | void settings_default(); 19 | void settings_save(); 20 | 21 | 22 | #endif -------------------------------------------------------------------------------- /源代码/watch.uvopt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1.0 5 | 6 |
### uVision Project, (C) Keil Software
7 | 8 | 9 | *.c 10 | *.s*; *.src; *.a* 11 | *.obj 12 | *.lib 13 | *.txt; *.h; *.inc 14 | *.plm 15 | *.cpp 16 | 0 17 | 18 | 19 | 20 | 0 21 | 0 22 | 23 | 24 | 25 | Target 1 26 | 0x0 27 | MCS-51 28 | 29 | 24000000 30 | 31 | 1 32 | 1 33 | 1 34 | 0 35 | 0 36 | 37 | 38 | 0 39 | 65535 40 | 0 41 | 0 42 | 0 43 | 44 | 45 | 120 46 | 65 47 | 8 48 | .\Listings\ 49 | 50 | 51 | 1 52 | 1 53 | 1 54 | 0 55 | 1 56 | 1 57 | 0 58 | 1 59 | 0 60 | 0 61 | 0 62 | 0 63 | 64 | 65 | 1 66 | 1 67 | 1 68 | 1 69 | 1 70 | 1 71 | 1 72 | 0 73 | 0 74 | 75 | 76 | 1 77 | 0 78 | 1 79 | 80 | 255 81 | 82 | 0 83 | 1 84 | 1 85 | 1 86 | 1 87 | 1 88 | 1 89 | 1 90 | 1 91 | 1 92 | 0 93 | 1 94 | 1 95 | 1 96 | 0 97 | 1 98 | 1 99 | 1 100 | 1 101 | 0 102 | 0 103 | 10 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | BIN\STCMON51.DLL 115 | 116 | 117 | 118 | 0 119 | DLGTP51 120 | (98=-1,-1,-1,-1,0)(82=-1,-1,-1,-1,0)(83=-1,-1,-1,-1,0)(84=-1,-1,-1,-1,0)(85=-1,-1,-1,-1,0)(80=-1,-1,-1,-1,0)(91=-1,-1,-1,-1,0)(92=-1,-1,-1,-1,0) 121 | 122 | 123 | 0 124 | STCMON51 125 | -S7 -B115200 -O0 -U0 126 | 127 | 128 | 0 129 | DLGDP51 130 | (98=-1,-1,-1,-1,0)(82=-1,-1,-1,-1,0)(83=-1,-1,-1,-1,0)(84=-1,-1,-1,-1,0)(85=-1,-1,-1,-1,0)(99=-1,-1,-1,-1,0)(91=-1,-1,-1,-1,0)(92=-1,-1,-1,-1,0)(5067=-1,-1,-1,-1,0) 131 | 132 | 133 | 134 | 135 | 136 | 1 137 | 0 138 | 0x0f80 139 | 0 140 | 141 | 142 | 143 | 144 | 0 145 | ls 146 | ls 147 | 148 | 149 | 1 150 | up 151 | class_update 152 | 153 | 154 | 155 | 0 156 | 157 | 158 | 0 159 | 1 160 | 0 161 | 0 162 | 0 163 | 0 164 | 0 165 | 1 166 | 0 167 | 0 168 | 0 169 | 0 170 | 0 171 | 0 172 | 0 173 | 0 174 | 0 175 | 0 176 | 0 177 | 0 178 | 0 179 | 0 180 | 0 181 | 0 182 | 183 | 184 | 185 | 0 186 | 187 | 188 | 0 189 | 190 | 191 | 192 | 193 | Source Group 1 194 | 1 195 | 0 196 | 0 197 | 0 198 | 199 | 1 200 | 1 201 | 2 202 | 0 203 | 0 204 | 0 205 | .\STARTUP.A51 206 | STARTUP.A51 207 | 0 208 | 0 209 | 210 | 211 | 1 212 | 2 213 | 1 214 | 0 215 | 0 216 | 0 217 | .\flash.c 218 | flash.c 219 | 0 220 | 0 221 | 222 | 223 | 1 224 | 3 225 | 1 226 | 0 227 | 0 228 | 0 229 | .\main.c 230 | main.c 231 | 0 232 | 0 233 | 234 | 235 | 1 236 | 4 237 | 1 238 | 0 239 | 0 240 | 0 241 | .\oled.c 242 | oled.c 243 | 0 244 | 0 245 | 246 | 247 | 1 248 | 5 249 | 1 250 | 0 251 | 0 252 | 0 253 | .\rtc.c 254 | rtc.c 255 | 0 256 | 0 257 | 258 | 259 | 1 260 | 6 261 | 1 262 | 0 263 | 0 264 | 0 265 | .\internal_iic.c 266 | internal_iic.c 267 | 0 268 | 0 269 | 270 | 271 | 1 272 | 7 273 | 1 274 | 0 275 | 0 276 | 0 277 | .\adc.c 278 | adc.c 279 | 0 280 | 0 281 | 282 | 283 | 1 284 | 8 285 | 1 286 | 0 287 | 0 288 | 0 289 | .\Terminal.c 290 | Terminal.c 291 | 0 292 | 0 293 | 294 | 295 | 1 296 | 9 297 | 1 298 | 0 299 | 0 300 | 0 301 | .\morse.c 302 | morse.c 303 | 0 304 | 0 305 | 306 | 307 | 1 308 | 10 309 | 1 310 | 0 311 | 0 312 | 0 313 | .\alarm.c 314 | alarm.c 315 | 0 316 | 0 317 | 318 | 319 | 1 320 | 11 321 | 1 322 | 0 323 | 0 324 | 0 325 | .\settings.c 326 | settings.c 327 | 0 328 | 0 329 | 330 | 331 | 1 332 | 12 333 | 1 334 | 0 335 | 0 336 | 0 337 | .\music.c 338 | music.c 339 | 0 340 | 0 341 | 342 | 343 | 1 344 | 13 345 | 1 346 | 0 347 | 0 348 | 0 349 | .\menu.c 350 | menu.c 351 | 0 352 | 0 353 | 354 | 355 | 1 356 | 14 357 | 1 358 | 0 359 | 0 360 | 0 361 | .\serial.c 362 | serial.c 363 | 0 364 | 0 365 | 366 | 367 | 368 |
369 | -------------------------------------------------------------------------------- /源代码/watch.uvproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1.1 5 | 6 |
### uVision Project, (C) Keil Software
7 | 8 | 9 | 10 | Target 1 11 | 0x0 12 | MCS-51 13 | 14 | 15 | STC8A8K64S4A12 16 | STC 17 | IRAM(0-0xFF) XRAM(0-0x1FFF) IROM(0-0xFFF8) CLOCK(35000000) MODP2 18 | 19 | "LIB\STARTUP.A51" ("Standard 8051 Startup Code") 20 | 21 | 63016 22 | STC8.H 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 0 34 | 0 35 | 36 | 37 | 38 | STC\ 39 | STC\ 40 | 41 | 0 42 | 0 43 | 0 44 | 0 45 | 1 46 | 47 | .\Objects\ 48 | watch 49 | 1 50 | 0 51 | 1 52 | 1 53 | 1 54 | .\Listings\ 55 | 0 56 | 0 57 | 0 58 | 59 | 0 60 | 0 61 | 62 | 63 | 0 64 | 0 65 | 0 66 | 0 67 | 68 | 69 | 0 70 | 0 71 | 72 | 73 | 0 74 | 0 75 | 0 76 | 0 77 | 78 | 79 | 0 80 | 0 81 | 82 | 83 | 0 84 | 0 85 | 0 86 | 0 87 | 88 | 1 89 | 90 | 91 | 92 | 0 93 | 0 94 | 0 95 | 0 96 | 0 97 | 1 98 | 0 99 | 0 100 | 0 101 | 0 102 | 3 103 | 104 | 105 | 1 106 | 65535 107 | 108 | 109 | S8051.DLL 110 | 111 | DP51.DLL 112 | -pDP8051 113 | S8051.DLL 114 | 115 | TP51.DLL 116 | -p51 117 | 118 | 119 | 120 | 0 121 | 0 122 | 0 123 | 0 124 | 16 125 | 126 | 127 | 0 128 | 1 129 | 1 130 | 1 131 | 1 132 | 1 133 | 1 134 | 1 135 | 0 136 | 1 137 | 138 | 139 | 1 140 | 1 141 | 0 142 | 1 143 | 1 144 | 1 145 | 0 146 | 1 147 | 1 148 | 1 149 | 150 | 0 151 | 10 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | BIN\STCMON51.DLL 166 | 167 | 168 | 169 | 170 | 0 171 | 0 172 | 0 173 | 0 174 | 0 175 | -1 176 | 177 | 0 178 | 179 | "" () 180 | 181 | 182 | 183 | 184 | 0 185 | 186 | 187 | 188 | 2 189 | 0 190 | 2 191 | 0 192 | 0 193 | 1 194 | 0 195 | 0 196 | 1 197 | 1 198 | 1 199 | 1 200 | 0 201 | 0 202 | 1 203 | 0 204 | 0 205 | 0 206 | 0 207 | 0 208 | 0 209 | 0 210 | 0 211 | 0 212 | 0 213 | 0 214 | 0 215 | 0 216 | 0 217 | 0 218 | 0 219 | 0 220 | 0 221 | 0 222 | 0 223 | 0 224 | 0 225 | 0 226 | 0 227 | 0 228 | 0 229 | 230 | 231 | 0 232 | 0x0 233 | 0xffff 234 | 235 | 236 | 0 237 | 0x0 238 | 0x0 239 | 240 | 241 | 0 242 | 0x0 243 | 0x0 244 | 245 | 246 | 0 247 | 0x0 248 | 0x0 249 | 250 | 251 | 0 252 | 0x0 253 | 0x0 254 | 255 | 256 | 0 257 | 0x0 258 | 0x0 259 | 260 | 261 | 0 262 | 0x0 263 | 0x0 264 | 265 | 266 | 0 267 | 0x0 268 | 0x0 269 | 270 | 271 | 1 272 | 0x0 273 | 0xfff9 274 | 275 | 276 | 0 277 | 0x0 278 | 0x100 279 | 280 | 281 | 0 282 | 0x0 283 | 0x2000 284 | 285 | 286 | 0 287 | 0x0 288 | 0x0 289 | 290 | 291 | 0 292 | 0x0 293 | 0x0 294 | 295 | 296 | 297 | 298 | 0 299 | 0 300 | 1 301 | 0 302 | 1 303 | 3 304 | 9 305 | 2 306 | 1 307 | 1 308 | 0 309 | 0 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 0 319 | 1 320 | 0 321 | 0 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 0 331 | 0 332 | 1 333 | 0 334 | 2 335 | 1 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | Source Group 1 365 | 366 | 367 | STARTUP.A51 368 | 2 369 | .\STARTUP.A51 370 | 371 | 372 | flash.c 373 | 1 374 | .\flash.c 375 | 376 | 377 | main.c 378 | 1 379 | .\main.c 380 | 381 | 382 | oled.c 383 | 1 384 | .\oled.c 385 | 386 | 387 | rtc.c 388 | 1 389 | .\rtc.c 390 | 391 | 392 | internal_iic.c 393 | 1 394 | .\internal_iic.c 395 | 396 | 397 | adc.c 398 | 1 399 | .\adc.c 400 | 401 | 402 | Terminal.c 403 | 1 404 | .\Terminal.c 405 | 406 | 407 | morse.c 408 | 1 409 | .\morse.c 410 | 411 | 412 | alarm.c 413 | 1 414 | .\alarm.c 415 | 416 | 417 | settings.c 418 | 1 419 | .\settings.c 420 | 421 | 422 | music.c 423 | 1 424 | .\music.c 425 | 426 | 427 | menu.c 428 | 1 429 | .\menu.c 430 | 431 | 432 | serial.c 433 | 1 434 | .\serial.c 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 |
443 | -------------------------------------------------------------------------------- /简单的外壳_3D模型/3D.skb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/简单的外壳_3D模型/3D.skb -------------------------------------------------------------------------------- /简单的外壳_3D模型/3D.skp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/简单的外壳_3D模型/3D.skp -------------------------------------------------------------------------------- /简单的外壳_3D模型/3D.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/简单的外壳_3D模型/3D.stl -------------------------------------------------------------------------------- /简单的外壳_3D模型/bottom.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/简单的外壳_3D模型/bottom.stl -------------------------------------------------------------------------------- /简单的外壳_3D模型/top.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diylxy/MyWatch/89518a46a0966eeccb69e1a39774be345e9f0960/简单的外壳_3D模型/top.stl --------------------------------------------------------------------------------