Projektarbeit Line Following Robot bei Prof. Chowanetz im WS22/23
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vcos_init.h 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. Copyright (c) 2012, Broadcom Europe Ltd
  3. All rights reserved.
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions are met:
  6. * Redistributions of source code must retain the above copyright
  7. notice, this list of conditions and the following disclaimer.
  8. * Redistributions in binary form must reproduce the above copyright
  9. notice, this list of conditions and the following disclaimer in the
  10. documentation and/or other materials provided with the distribution.
  11. * Neither the name of the copyright holder nor the
  12. names of its contributors may be used to endorse or promote products
  13. derived from this software without specific prior written permission.
  14. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  15. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  16. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  17. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
  18. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  19. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  20. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  21. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  23. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. /*=============================================================================
  26. VideoCore OS Abstraction Layer - initialization routines
  27. =============================================================================*/
  28. #include "vcos_types.h"
  29. #include "pthreads/vcos_platform.h"
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. /** \file
  34. *
  35. * Some OS support libraries need some initialization. To support this, call
  36. * vcos_init() function at the start of day; vcos_deinit() at the end.
  37. */
  38. /**
  39. * vcos initialization. Call this function before using other vcos functions.
  40. * Calls can be nested within the same process; they are reference counted so
  41. * that only a call from uninitialized state has any effect.
  42. * @note On platforms/toolchains that support it, gcc's constructor attribute or
  43. * similar is used to invoke this function before main() or equivalent.
  44. * @return Status of initialisation.
  45. */
  46. VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_init(void);
  47. /**
  48. * vcos deinitialization. Call this function when vcos is no longer required,
  49. * in order to free resources.
  50. * Calls can be nested within the same process; they are reference counted so
  51. * that only a call that decrements the reference count to 0 has any effect.
  52. * @note On platforms/toolchains that support it, gcc's destructor attribute or
  53. * similar is used to invoke this function after exit() or equivalent.
  54. * @return Status of initialisation.
  55. */
  56. VCOSPRE_ void VCOSPOST_ vcos_deinit(void);
  57. /**
  58. * Acquire global lock. This must be available independent of vcos_init()/vcos_deinit().
  59. */
  60. VCOSPRE_ void VCOSPOST_ vcos_global_lock(void);
  61. /**
  62. * Release global lock. This must be available independent of vcos_init()/vcos_deinit().
  63. */
  64. VCOSPRE_ void VCOSPOST_ vcos_global_unlock(void);
  65. /** Pass in the argv/argc arguments passed to main() */
  66. VCOSPRE_ void VCOSPOST_ vcos_set_args(int argc, const char **argv);
  67. /** Return argc. */
  68. VCOSPRE_ int VCOSPOST_ vcos_get_argc(void);
  69. /** Return argv. */
  70. VCOSPRE_ const char ** VCOSPOST_ vcos_get_argv(void);
  71. /**
  72. * Platform-specific initialisation.
  73. * VCOS internal function, not part of public API, do not call from outside
  74. * vcos. vcos_init()/vcos_deinit() reference count calls, so this function is
  75. * only called from an uninitialized state, i.e. there will not be two
  76. * consecutive calls to vcos_platform_init() without an intervening call to
  77. * vcos_platform_deinit().
  78. * This function is called with vcos_global_lock held.
  79. * @return Status of initialisation.
  80. */
  81. VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_platform_init(void);
  82. /**
  83. * Platform-specific de-initialisation.
  84. * VCOS internal function, not part of public API, do not call from outside
  85. * vcos.
  86. * See vcos_platform_init() re reference counting.
  87. * This function is called with vcos_global_lock held.
  88. */
  89. VCOSPRE_ void VCOSPOST_ vcos_platform_deinit(void);
  90. #ifdef __cplusplus
  91. }
  92. #endif