log.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /**************************************************************************************************
  2. Phyplus Microelectronics Limited confidential and proprietary.
  3. All rights reserved.
  4. IMPORTANT: All rights of this software belong to Phyplus Microelectronics
  5. Limited ("Phyplus"). Your use of this Software is limited to those
  6. specific rights granted under the terms of the business contract, the
  7. confidential agreement, the non-disclosure agreement and any other forms
  8. of agreements as a customer or a partner of Phyplus. You may not use this
  9. Software unless you agree to abide by the terms of these agreements.
  10. You acknowledge that the Software may not be modified, copied,
  11. distributed or disclosed unless embedded on a Phyplus Bluetooth Low Energy
  12. (BLE) integrated circuit, either as a product or is integrated into your
  13. products. Other than for the aforementioned purposes, you may not use,
  14. reproduce, copy, prepare derivative works of, modify, distribute, perform,
  15. display or sell this Software and/or its documentation for any purposes.
  16. YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
  17. PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  18. INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
  19. NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
  20. PHYPLUS OR ITS SUBSIDIARIES BE LIABLE OR OBLIGATED UNDER CONTRACT,
  21. NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
  22. LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
  23. INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
  24. OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
  25. OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
  26. (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
  27. **************************************************************************************************/
  28. /*******************************************************************************
  29. * @file log.h
  30. * @brief Contains all functions support for uart driver
  31. * @version 0.0
  32. * @date 31. Jan. 2018
  33. * @author eagle.han
  34. *
  35. * Copyright(C) 2016, PhyPlus Semiconductor
  36. * All rights reserved.
  37. *
  38. *******************************************************************************/
  39. #ifndef __LOG_H__
  40. #define __LOG_H__
  41. #include "uart.h"
  42. void phy_printf(const char *format, ...);
  43. void phy_printf_init(void);
  44. #ifndef DEBUG_INFO
  45. #error "DEBUG_INFO undefined!"
  46. #endif
  47. typedef void(*std_putc)(char* data, uint16_t size);
  48. #define AT_LOG(...)
  49. #define LOG(...) phy_printf(__VA_ARGS__)
  50. #define LOG_INIT() phy_printf_init()
  51. // #if(DEBUG_INFO == 1)
  52. // #define AT_LOG(...)
  53. // #define LOG(...) phy_printf(__VA_ARGS__)
  54. // #define LOG_INIT() phy_printf_init()
  55. // #elif(DEBUG_INFO == 2)
  56. // #define AT_LOG(...) phy_printf(##__VA_ARGS__)
  57. // #define LOG(...)
  58. // #define LOG_INIT() phy_printf_init()
  59. // #elif(DEBUG_INFO == 3)
  60. // #define LOG(...) phy_printf(##__VA_ARGS__)
  61. // #define AT_LOG(...) phy_printf(##__VA_ARGS__)
  62. // #define LOG_INIT() phy_printf_init()
  63. // #elif(DEBUG_INFO == 4)
  64. // extern void bleMesh_uart_init(void);
  65. // #define AT_LOG(...)
  66. // #define LOG(...)
  67. // #define LOG_INIT() bleMesh_uart_init()
  68. // #else
  69. // #define AT_LOG(...)
  70. // #define LOG(...)
  71. // #define LOG_INIT() //{clk_gate_enable(MOD_UART);clk_reset(MOD_UART);clk_gate_disable(MOD_UART);}
  72. // #endif
  73. #endif //__LOG_H__