clock_config.hxx 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /////////////////////////////////////////////////////////////////////////////
  2. // apps/include/graphics/twm4nx/apps/clock_config.hxx
  3. //
  4. // Licensed to the Apache Software Foundation (ASF) under one or more
  5. // contributor license agreements. See the NOTICE file distributed with
  6. // this work for additional information regarding copyright ownership. The
  7. // ASF licenses this file to you under the Apache License, Version 2.0 (the
  8. // "License"); you may not use this file except in compliance with the
  9. // License. You may obtain a copy of the License at
  10. //
  11. // http://www.apache.org/licenses/LICENSE-2.0
  12. //
  13. // Unless required by applicable law or agreed to in writing, software
  14. // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  16. // License for the specific language governing permissions and limitations
  17. // under the License.
  18. //
  19. /////////////////////////////////////////////////////////////////////////////
  20. #ifndef __APPS_INCLUDE_GRAPHICS_TWM4NX_APPS_CLOCK_CONFIG_HXX
  21. #define __APPS_INCLUDE_GRAPHICS_TWM4NX_APPS_CLOCK_CONFIG_HXX
  22. /////////////////////////////////////////////////////////////////////////////
  23. // Included Files
  24. /////////////////////////////////////////////////////////////////////////////
  25. #include <nuttx/config.h>
  26. #include <debug.h>
  27. #include "graphics/nxglyphs.hxx"
  28. #include "graphics/nxwidgets/crlepalettebitmap.hxx"
  29. #include "graphics/twm4nx/twm4nx_config.hxx"
  30. #ifdef CONFIG_TWM4NX_CLOCK
  31. /////////////////////////////////////////////////////////////////////////////
  32. // Pre-Processor Definitions
  33. /////////////////////////////////////////////////////////////////////////////
  34. // General Configuration ////////////////////////////////////////////////////
  35. /**
  36. * Required settings:
  37. *
  38. * CONFIG_HAVE_CXX : C++ support is required
  39. * CONFIG_NX : NX must enabled
  40. * CONFIG_GRAPHICS_SLCD : For segment LCD emulation
  41. */
  42. #ifndef CONFIG_HAVE_CXX
  43. # error C++ support is required (CONFIG_HAVE_CXX)
  44. #endif
  45. #ifndef CONFIG_NX
  46. # error NX support is required (CONFIG_NX)
  47. #endif
  48. #ifndef CONFIG_GRAPHICS_SLCD
  49. # warning Segment LCD emulation is required (CONFIG_GRAPHICS_SLCD)
  50. #endif
  51. // Clock Window /////////////////////////////////////////////////////////////
  52. /**
  53. * Clock Window Configuration
  54. *
  55. * CONFIG_TWM4NX_CLOCK_PRIO - Priority of the Clock task. Default:
  56. * SCHED_PRIORITY_DEFAULT. NOTE: This priority should be less than
  57. * CONFIG_NXSTART_SERVERPRIO or else there may be data overrun errors.
  58. * Such errors would most likely appear as duplicated rows of data on the
  59. * display.
  60. * CONFIG_TWM4NX_CLOCK_STACKSIZE - The stack size to use when starting the
  61. * Clock task. Default: 1024 bytes.
  62. * CONFIG_TWM4NX_CLOCK_ICON - The glyph to use as the Clock icon
  63. * CONFIG_TWM4NX_CLOCK_HEIGHT - The fixed height of the clock
  64. */
  65. // Tasking
  66. #ifndef CONFIG_TWM4NX_CLOCK_PRIO
  67. # define CONFIG_TWM4NX_CLOCK_PRIO SCHED_PRIORITY_DEFAULT
  68. #endif
  69. #if CONFIG_NXSTART_SERVERPRIO <= CONFIG_TWM4NX_CLOCK_PRIO
  70. # warning "CONFIG_NXSTART_SERVERPRIO <= CONFIG_TWM4NX_CLOCK_PRIO"
  71. # warning" -- This can result in data overrun errors"
  72. #endif
  73. #ifndef CONFIG_TWM4NX_CLOCK_STACKSIZE
  74. # define CONFIG_TWM4NX_CLOCK_STACKSIZE 1024
  75. #endif
  76. // Colors -- Controlled by the CSLcd configuration
  77. // The Clock window glyph
  78. #ifndef CONFIG_TWM4NX_CLOCK_ICON
  79. # define CONFIG_TWM4NX_CLOCK_ICON NXWidgets::g_lcdClockBitmap
  80. #endif
  81. // The fixed clock window height
  82. #ifndef CONFIG_TWM4NX_CLOCK_HEIGHT
  83. # define CONFIG_TWM4NX_CLOCK_HEIGHT 64
  84. #endif
  85. // Spacing
  86. #ifndef CONFIG_TWM4NX_CLOCK_HSPACING
  87. # define CONFIG_TWM4NX_CLOCK_HSPACING 2
  88. #endif
  89. #ifndef CONFIG_TWM4NX_CLOCK_VSPACING
  90. # define CONFIG_TWM4NX_CLOCK_VSPACING 2
  91. #endif
  92. #endif // CONFIG_TWM4NX_CLOCK
  93. #endif // __APPS_INCLUDE_GRAPHICS_TWM4NX_APPS_CLOCK_CONFIG_HXX