Simple single-color 8x8x8 LED Cube with AVRs
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

strings.c 4.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * strings.c
  3. *
  4. * Copyright 2012 Thomas Buck <xythobuz@me.com>
  5. *
  6. * This file is part of LED-Cube.
  7. *
  8. * LED-Cube is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * LED-Cube is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with LED-Cube. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. #include <avr/pgmspace.h>
  22. #include "transmit.h"
  23. const char stringVersion[] PROGMEM = "v3.0\n"; // 0
  24. // Help Text
  25. const char stringHelp1[] PROGMEM = "(d)elete, (g)et anims, (s)et anims, (v)ersion\n"; // 6
  26. const char stringHelp2[] PROGMEM = "(t)ime, (a)udio, (c)ount, (x)Custom count\n"; // 7
  27. const char stringHelp3[] PROGMEM = "(y)Set a frame, sim(p)le anim\n"; // 8
  28. const char stringHelp4[] PROGMEM = "t(e)st, (m)ode, d(u)mp\n"; // 9
  29. const char stringHelp5[] PROGMEM = "Play S(n)ake\n"; // 10
  30. const char stringHelp9[] PROGMEM = "(i)nterrupt count, (r)andom, (q)reset\n"; // 26
  31. const char stringExtern[] PROGMEM = "(f)ormat memory, (w)rite text\n"; // 34
  32. const char stringWritten[] PROGMEM = "durati(o)n\n"; // 17
  33. const char stringHelp6[] PROGMEM = "All LEDs Off/On (0/1)\n"; // 11
  34. const char stringHelp7[] PROGMEM = "(2): Test Anim. 1\n"; // 12
  35. const char stringHelp8[] PROGMEM = "(3): Font Test\n"; // 13
  36. const char stringSelfTestError[] PROGMEM = "Self-Test Error: 0b"; // 1
  37. const char stringInit[] PROGMEM = "Initialized!\n"; // 2
  38. const char stringAudioError[] PROGMEM = " => No answer from Audio!\n"; // 3
  39. const char stringMemError[] PROGMEM = " => No answer from Memory!\n"; // 4
  40. const char stringMemWriteError[] PROGMEM = " => Can't write to Memory!\n"; // 5
  41. const char stringTime[] PROGMEM = "System Time: "; // 14
  42. const char stringFrames[] PROGMEM = " Frames stored\n"; // 15
  43. const char stringByte[] PROGMEM = "New animation count: "; // 16
  44. const char stringCount[] PROGMEM = "Frame to change: "; // 18
  45. const char stringSelfTest[] PROGMEM = "Self-Test: 0b"; // 19
  46. const char stringKillCount[] PROGMEM = "Killed Animation Counter!\n"; // 20
  47. const char stringAccessError[] PROGMEM = "Could not access device!\n"; // 21
  48. const char stringAudioData[] PROGMEM = "Audio Data:\n"; // 22
  49. const char stringSnakeControl[] PROGMEM = "Controls: W A S D Q E, x to quit\n"; // 23
  50. const char stringNoMoreHeap[] PROGMEM = "Ran out of Heap!\n"; // 24
  51. const char stringKilledAnimation[] PROGMEM = "Animation aborted!\n"; // 25
  52. const char stringInterrupts[] PROGMEM = " Interrupts after 1000msec\n"; // 27
  53. const char stringFrames2[] PROGMEM = " Frames per Second\n"; // 28
  54. const char stringDeleted[] PROGMEM = "Memory deleted!\n"; // 29
  55. const char stringReset[] PROGMEM = "Reset in 500ms. Bye!\n"; // 30
  56. const char stringWatchdog[] PROGMEM = "Enter frame to dump: "; // 31
  57. const char stringBrownout[] PROGMEM = "Formatting memory... "; // 32
  58. const char stringNothing[] PROGMEM = "Done!\n"; // 33
  59. const char stringJtag[] PROGMEM = "Duration: "; // 35
  60. const char stringPowerOn[] PROGMEM = "Start: "; // 36
  61. const char stringMinute[] PROGMEM = "8 Layerbytes...\n"; // 37
  62. const char stringAudioMode[] PROGMEM = "Storing in 8 frames...\n"; // 38
  63. const char stringCubeMode[] PROGMEM = "Ende: "; // 39
  64. const char stringModeChange[] PROGMEM = "Cube mode entered!\n"; // 40
  65. const char stringModeChange2[] PROGMEM = "Audio mode entered!\n"; // 41
  66. const char stringRenderText[] PROGMEM = "Text: "; // 42
  67. // Last index + 1
  68. #define STRINGNUM 43
  69. PGM_P stringTable[STRINGNUM] PROGMEM = { stringVersion, stringSelfTestError, stringInit,
  70. stringAudioError, stringMemError, stringMemWriteError,
  71. stringHelp1, stringHelp2, stringHelp3, stringHelp4, stringHelp5,
  72. stringHelp6, stringHelp7, stringHelp8, stringTime, stringFrames,
  73. stringByte, stringWritten, stringCount, stringSelfTest,
  74. stringKillCount, stringAccessError, stringAudioData,
  75. stringSnakeControl, stringNoMoreHeap, stringKilledAnimation,
  76. stringHelp9, stringInterrupts, stringFrames2, stringDeleted,
  77. stringReset, stringWatchdog, stringBrownout, stringNothing,
  78. stringExtern, stringJtag, stringPowerOn, stringMinute, stringAudioMode,
  79. stringCubeMode, stringModeChange, stringModeChange2, stringRenderText };
  80. char stringNotFoundError[] PROGMEM = "String not found!\n";
  81. char *getString(uint8_t id) {
  82. if (id < STRINGNUM) {
  83. strcpy_P(buffer, (PGM_P)pgm_read_word(&(stringTable[id])));
  84. } else {
  85. strcpy_P(buffer, (PGM_P)pgm_read_word(&stringNotFoundError));
  86. }
  87. return buffer;
  88. }