+++ /dev/null
-cff8f4280c45076cae6293850f2af2fe
\ No newline at end of file
+++ /dev/null
-#ifdef __cplusplus
-# error "A C++ compiler has been selected for C."
-#endif
-
-#if defined(__18CXX)
-# define ID_VOID_MAIN
-#endif
-#if defined(__CLASSIC_C__)
-/* cv-qualifiers did not exist in K&R C */
-# define const
-# define volatile
-#endif
-
-#if !defined(__has_include)
-/* If the compiler does not have __has_include, pretend the answer is
- always no. */
-# define __has_include(x) 0
-#endif
-
-
-/* Version number components: V=Version, R=Revision, P=Patch
- Version date components: YYYY=Year, MM=Month, DD=Day */
-
-#if defined(__INTEL_COMPILER) || defined(__ICC)
-# define COMPILER_ID "Intel"
-# if defined(_MSC_VER)
-# define SIMULATE_ID "MSVC"
-# endif
-# if defined(__GNUC__)
-# define SIMULATE_ID "GNU"
-# endif
- /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later,
- except that a few beta releases use the old format with V=2021. */
-# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111
-# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
-# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
-# if defined(__INTEL_COMPILER_UPDATE)
-# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
-# else
-# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
-# endif
-# else
-# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER)
-# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE)
- /* The third version component from --version is an update index,
- but no macro is provided for it. */
-# define COMPILER_VERSION_PATCH DEC(0)
-# endif
-# if defined(__INTEL_COMPILER_BUILD_DATE)
- /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
-# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
-# endif
-# if defined(_MSC_VER)
- /* _MSC_VER = VVRR */
-# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
-# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
-# endif
-# if defined(__GNUC__)
-# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
-# elif defined(__GNUG__)
-# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
-# endif
-# if defined(__GNUC_MINOR__)
-# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
-# endif
-# if defined(__GNUC_PATCHLEVEL__)
-# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
-# endif
-
-#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER)
-# define COMPILER_ID "IntelLLVM"
-#if defined(_MSC_VER)
-# define SIMULATE_ID "MSVC"
-#endif
-#if defined(__GNUC__)
-# define SIMULATE_ID "GNU"
-#endif
-/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and
- * later. Look for 6 digit vs. 8 digit version number to decide encoding.
- * VVVV is no smaller than the current year when a version is released.
- */
-#if __INTEL_LLVM_COMPILER < 1000000L
-# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100)
-# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10)
-# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10)
-#else
-# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000)
-# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100)
-# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100)
-#endif
-#if defined(_MSC_VER)
- /* _MSC_VER = VVRR */
-# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
-# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
-#endif
-#if defined(__GNUC__)
-# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
-#elif defined(__GNUG__)
-# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
-#endif
-#if defined(__GNUC_MINOR__)
-# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
-#endif
-#if defined(__GNUC_PATCHLEVEL__)
-# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
-#endif
-
-#elif defined(__PATHCC__)
-# define COMPILER_ID "PathScale"
-# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
-# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
-# if defined(__PATHCC_PATCHLEVEL__)
-# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
-# endif
-
-#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
-# define COMPILER_ID "Embarcadero"
-# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
-# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
-# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
-
-#elif defined(__BORLANDC__)
-# define COMPILER_ID "Borland"
- /* __BORLANDC__ = 0xVRR */
-# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
-# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
-
-#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
-# define COMPILER_ID "Watcom"
- /* __WATCOMC__ = VVRR */
-# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
-# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
-# if (__WATCOMC__ % 10) > 0
-# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
-# endif
-
-#elif defined(__WATCOMC__)
-# define COMPILER_ID "OpenWatcom"
- /* __WATCOMC__ = VVRP + 1100 */
-# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
-# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
-# if (__WATCOMC__ % 10) > 0
-# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
-# endif
-
-#elif defined(__SUNPRO_C)
-# define COMPILER_ID "SunPro"
-# if __SUNPRO_C >= 0x5100
- /* __SUNPRO_C = 0xVRRP */
-# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12)
-# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF)
-# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
-# else
- /* __SUNPRO_CC = 0xVRP */
-# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8)
-# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF)
-# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
-# endif
-
-#elif defined(__HP_cc)
-# define COMPILER_ID "HP"
- /* __HP_cc = VVRRPP */
-# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
-# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
-# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100)
-
-#elif defined(__DECC)
-# define COMPILER_ID "Compaq"
- /* __DECC_VER = VVRRTPPPP */
-# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
-# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100)
-# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000)
-
-#elif defined(__IBMC__) && defined(__COMPILER_VER__)
-# define COMPILER_ID "zOS"
- /* __IBMC__ = VRP */
-# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
-# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
-# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
-
-#elif defined(__open_xl__) && defined(__clang__)
-# define COMPILER_ID "IBMClang"
-# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__)
-# define COMPILER_VERSION_MINOR DEC(__open_xl_release__)
-# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__)
-# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__)
-
-
-#elif defined(__ibmxl__) && defined(__clang__)
-# define COMPILER_ID "XLClang"
-# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
-# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
-# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
-# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
-
-
-#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800
-# define COMPILER_ID "XL"
- /* __IBMC__ = VRP */
-# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
-# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
-# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
-
-#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800
-# define COMPILER_ID "VisualAge"
- /* __IBMC__ = VRP */
-# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
-# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
-# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
-
-#elif defined(__NVCOMPILER)
-# define COMPILER_ID "NVHPC"
-# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__)
-# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__)
-# if defined(__NVCOMPILER_PATCHLEVEL__)
-# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__)
-# endif
-
-#elif defined(__PGI)
-# define COMPILER_ID "PGI"
-# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
-# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
-# if defined(__PGIC_PATCHLEVEL__)
-# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
-# endif
-
-#elif defined(__clang__) && defined(__cray__)
-# define COMPILER_ID "CrayClang"
-# define COMPILER_VERSION_MAJOR DEC(__cray_major__)
-# define COMPILER_VERSION_MINOR DEC(__cray_minor__)
-# define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__)
-# define COMPILER_VERSION_INTERNAL_STR __clang_version__
-
-
-#elif defined(_CRAYC)
-# define COMPILER_ID "Cray"
-# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
-# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
-
-#elif defined(__TI_COMPILER_VERSION__)
-# define COMPILER_ID "TI"
- /* __TI_COMPILER_VERSION__ = VVVRRRPPP */
-# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
-# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
-# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
-
-#elif defined(__CLANG_FUJITSU)
-# define COMPILER_ID "FujitsuClang"
-# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
-# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
-# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
-# define COMPILER_VERSION_INTERNAL_STR __clang_version__
-
-
-#elif defined(__FUJITSU)
-# define COMPILER_ID "Fujitsu"
-# if defined(__FCC_version__)
-# define COMPILER_VERSION __FCC_version__
-# elif defined(__FCC_major__)
-# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
-# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
-# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
-# endif
-# if defined(__fcc_version)
-# define COMPILER_VERSION_INTERNAL DEC(__fcc_version)
-# elif defined(__FCC_VERSION)
-# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION)
-# endif
-
-
-#elif defined(__ghs__)
-# define COMPILER_ID "GHS"
-/* __GHS_VERSION_NUMBER = VVVVRP */
-# ifdef __GHS_VERSION_NUMBER
-# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
-# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
-# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
-# endif
-
-#elif defined(__TASKING__)
-# define COMPILER_ID "Tasking"
- # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000)
- # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100)
-# define COMPILER_VERSION_INTERNAL DEC(__VERSION__)
-
-#elif defined(__ORANGEC__)
-# define COMPILER_ID "OrangeC"
-# define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__)
-# define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__)
-# define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__)
-
-#elif defined(__TINYC__)
-# define COMPILER_ID "TinyCC"
-
-#elif defined(__BCC__)
-# define COMPILER_ID "Bruce"
-
-#elif defined(__SCO_VERSION__)
-# define COMPILER_ID "SCO"
-
-#elif defined(__ARMCC_VERSION) && !defined(__clang__)
-# define COMPILER_ID "ARMCC"
-#if __ARMCC_VERSION >= 1000000
- /* __ARMCC_VERSION = VRRPPPP */
- # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
- # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
- # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
-#else
- /* __ARMCC_VERSION = VRPPPP */
- # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
- # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
- # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
-#endif
-
-
-#elif defined(__clang__) && defined(__apple_build_version__)
-# define COMPILER_ID "AppleClang"
-# if defined(_MSC_VER)
-# define SIMULATE_ID "MSVC"
-# endif
-# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
-# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
-# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
-# if defined(_MSC_VER)
- /* _MSC_VER = VVRR */
-# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
-# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
-# endif
-# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
-
-#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
-# define COMPILER_ID "ARMClang"
- # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
- # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
- # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100)
-# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
-
-#elif defined(__clang__) && defined(__ti__)
-# define COMPILER_ID "TIClang"
- # define COMPILER_VERSION_MAJOR DEC(__ti_major__)
- # define COMPILER_VERSION_MINOR DEC(__ti_minor__)
- # define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__)
-# define COMPILER_VERSION_INTERNAL DEC(__ti_version__)
-
-#elif defined(__clang__)
-# define COMPILER_ID "Clang"
-# if defined(_MSC_VER)
-# define SIMULATE_ID "MSVC"
-# endif
-# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
-# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
-# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
-# if defined(_MSC_VER)
- /* _MSC_VER = VVRR */
-# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
-# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
-# endif
-
-#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__))
-# define COMPILER_ID "LCC"
-# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100)
-# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100)
-# if defined(__LCC_MINOR__)
-# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__)
-# endif
-# if defined(__GNUC__) && defined(__GNUC_MINOR__)
-# define SIMULATE_ID "GNU"
-# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
-# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
-# if defined(__GNUC_PATCHLEVEL__)
-# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
-# endif
-# endif
-
-#elif defined(__GNUC__)
-# define COMPILER_ID "GNU"
-# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
-# if defined(__GNUC_MINOR__)
-# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
-# endif
-# if defined(__GNUC_PATCHLEVEL__)
-# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
-# endif
-
-#elif defined(_MSC_VER)
-# define COMPILER_ID "MSVC"
- /* _MSC_VER = VVRR */
-# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
-# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
-# if defined(_MSC_FULL_VER)
-# if _MSC_VER >= 1400
- /* _MSC_FULL_VER = VVRRPPPPP */
-# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
-# else
- /* _MSC_FULL_VER = VVRRPPPP */
-# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
-# endif
-# endif
-# if defined(_MSC_BUILD)
-# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
-# endif
-
-#elif defined(_ADI_COMPILER)
-# define COMPILER_ID "ADSP"
-#if defined(__VERSIONNUM__)
- /* __VERSIONNUM__ = 0xVVRRPPTT */
-# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF)
-# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF)
-# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF)
-# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF)
-#endif
-
-#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
-# define COMPILER_ID "IAR"
-# if defined(__VER__) && defined(__ICCARM__)
-# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
-# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
-# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
-# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
-# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__))
-# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
-# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
-# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
-# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
-# endif
-
-#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC)
-# define COMPILER_ID "SDCC"
-# if defined(__SDCC_VERSION_MAJOR)
-# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR)
-# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR)
-# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH)
-# else
- /* SDCC = VRP */
-# define COMPILER_VERSION_MAJOR DEC(SDCC/100)
-# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
-# define COMPILER_VERSION_PATCH DEC(SDCC % 10)
-# endif
-
-
-/* These compilers are either not known or too old to define an
- identification macro. Try to identify the platform and guess that
- it is the native compiler. */
-#elif defined(__hpux) || defined(__hpua)
-# define COMPILER_ID "HP"
-
-#else /* unknown compiler */
-# define COMPILER_ID ""
-#endif
-
-/* Construct the string literal in pieces to prevent the source from
- getting matched. Store it in a pointer rather than an array
- because some compilers will just produce instructions to fill the
- array rather than assigning a pointer to a static array. */
-char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
-#ifdef SIMULATE_ID
-char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
-#endif
-
-#ifdef __QNXNTO__
-char const* qnxnto = "INFO" ":" "qnxnto[]";
-#endif
-
-#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
-char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
-#endif
-
-#define STRINGIFY_HELPER(X) #X
-#define STRINGIFY(X) STRINGIFY_HELPER(X)
-
-/* Identify known platforms by name. */
-#if defined(__linux) || defined(__linux__) || defined(linux)
-# define PLATFORM_ID "Linux"
-
-#elif defined(__MSYS__)
-# define PLATFORM_ID "MSYS"
-
-#elif defined(__CYGWIN__)
-# define PLATFORM_ID "Cygwin"
-
-#elif defined(__MINGW32__)
-# define PLATFORM_ID "MinGW"
-
-#elif defined(__APPLE__)
-# define PLATFORM_ID "Darwin"
-
-#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
-# define PLATFORM_ID "Windows"
-
-#elif defined(__FreeBSD__) || defined(__FreeBSD)
-# define PLATFORM_ID "FreeBSD"
-
-#elif defined(__NetBSD__) || defined(__NetBSD)
-# define PLATFORM_ID "NetBSD"
-
-#elif defined(__OpenBSD__) || defined(__OPENBSD)
-# define PLATFORM_ID "OpenBSD"
-
-#elif defined(__sun) || defined(sun)
-# define PLATFORM_ID "SunOS"
-
-#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
-# define PLATFORM_ID "AIX"
-
-#elif defined(__hpux) || defined(__hpux__)
-# define PLATFORM_ID "HP-UX"
-
-#elif defined(__HAIKU__)
-# define PLATFORM_ID "Haiku"
-
-#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
-# define PLATFORM_ID "BeOS"
-
-#elif defined(__QNX__) || defined(__QNXNTO__)
-# define PLATFORM_ID "QNX"
-
-#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
-# define PLATFORM_ID "Tru64"
-
-#elif defined(__riscos) || defined(__riscos__)
-# define PLATFORM_ID "RISCos"
-
-#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
-# define PLATFORM_ID "SINIX"
-
-#elif defined(__UNIX_SV__)
-# define PLATFORM_ID "UNIX_SV"
-
-#elif defined(__bsdos__)
-# define PLATFORM_ID "BSDOS"
-
-#elif defined(_MPRAS) || defined(MPRAS)
-# define PLATFORM_ID "MP-RAS"
-
-#elif defined(__osf) || defined(__osf__)
-# define PLATFORM_ID "OSF1"
-
-#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
-# define PLATFORM_ID "SCO_SV"
-
-#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
-# define PLATFORM_ID "ULTRIX"
-
-#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
-# define PLATFORM_ID "Xenix"
-
-#elif defined(__WATCOMC__)
-# if defined(__LINUX__)
-# define PLATFORM_ID "Linux"
-
-# elif defined(__DOS__)
-# define PLATFORM_ID "DOS"
-
-# elif defined(__OS2__)
-# define PLATFORM_ID "OS2"
-
-# elif defined(__WINDOWS__)
-# define PLATFORM_ID "Windows3x"
-
-# elif defined(__VXWORKS__)
-# define PLATFORM_ID "VxWorks"
-
-# else /* unknown platform */
-# define PLATFORM_ID
-# endif
-
-#elif defined(__INTEGRITY)
-# if defined(INT_178B)
-# define PLATFORM_ID "Integrity178"
-
-# else /* regular Integrity */
-# define PLATFORM_ID "Integrity"
-# endif
-
-# elif defined(_ADI_COMPILER)
-# define PLATFORM_ID "ADSP"
-
-#else /* unknown platform */
-# define PLATFORM_ID
-
-#endif
-
-/* For windows compilers MSVC and Intel we can determine
- the architecture of the compiler being used. This is because
- the compilers do not have flags that can change the architecture,
- but rather depend on which compiler is being used
-*/
-#if defined(_WIN32) && defined(_MSC_VER)
-# if defined(_M_IA64)
-# define ARCHITECTURE_ID "IA64"
-
-# elif defined(_M_ARM64EC)
-# define ARCHITECTURE_ID "ARM64EC"
-
-# elif defined(_M_X64) || defined(_M_AMD64)
-# define ARCHITECTURE_ID "x64"
-
-# elif defined(_M_IX86)
-# define ARCHITECTURE_ID "X86"
-
-# elif defined(_M_ARM64)
-# define ARCHITECTURE_ID "ARM64"
-
-# elif defined(_M_ARM)
-# if _M_ARM == 4
-# define ARCHITECTURE_ID "ARMV4I"
-# elif _M_ARM == 5
-# define ARCHITECTURE_ID "ARMV5I"
-# else
-# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
-# endif
-
-# elif defined(_M_MIPS)
-# define ARCHITECTURE_ID "MIPS"
-
-# elif defined(_M_SH)
-# define ARCHITECTURE_ID "SHx"
-
-# else /* unknown architecture */
-# define ARCHITECTURE_ID ""
-# endif
-
-#elif defined(__WATCOMC__)
-# if defined(_M_I86)
-# define ARCHITECTURE_ID "I86"
-
-# elif defined(_M_IX86)
-# define ARCHITECTURE_ID "X86"
-
-# else /* unknown architecture */
-# define ARCHITECTURE_ID ""
-# endif
-
-#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
-# if defined(__ICCARM__)
-# define ARCHITECTURE_ID "ARM"
-
-# elif defined(__ICCRX__)
-# define ARCHITECTURE_ID "RX"
-
-# elif defined(__ICCRH850__)
-# define ARCHITECTURE_ID "RH850"
-
-# elif defined(__ICCRL78__)
-# define ARCHITECTURE_ID "RL78"
-
-# elif defined(__ICCRISCV__)
-# define ARCHITECTURE_ID "RISCV"
-
-# elif defined(__ICCAVR__)
-# define ARCHITECTURE_ID "AVR"
-
-# elif defined(__ICC430__)
-# define ARCHITECTURE_ID "MSP430"
-
-# elif defined(__ICCV850__)
-# define ARCHITECTURE_ID "V850"
-
-# elif defined(__ICC8051__)
-# define ARCHITECTURE_ID "8051"
-
-# elif defined(__ICCSTM8__)
-# define ARCHITECTURE_ID "STM8"
-
-# else /* unknown architecture */
-# define ARCHITECTURE_ID ""
-# endif
-
-#elif defined(__ghs__)
-# if defined(__PPC64__)
-# define ARCHITECTURE_ID "PPC64"
-
-# elif defined(__ppc__)
-# define ARCHITECTURE_ID "PPC"
-
-# elif defined(__ARM__)
-# define ARCHITECTURE_ID "ARM"
-
-# elif defined(__x86_64__)
-# define ARCHITECTURE_ID "x64"
-
-# elif defined(__i386__)
-# define ARCHITECTURE_ID "X86"
-
-# else /* unknown architecture */
-# define ARCHITECTURE_ID ""
-# endif
-
-#elif defined(__clang__) && defined(__ti__)
-# if defined(__ARM_ARCH)
-# define ARCHITECTURE_ID "Arm"
-
-# else /* unknown architecture */
-# define ARCHITECTURE_ID ""
-# endif
-
-#elif defined(__TI_COMPILER_VERSION__)
-# if defined(__TI_ARM__)
-# define ARCHITECTURE_ID "ARM"
-
-# elif defined(__MSP430__)
-# define ARCHITECTURE_ID "MSP430"
-
-# elif defined(__TMS320C28XX__)
-# define ARCHITECTURE_ID "TMS320C28x"
-
-# elif defined(__TMS320C6X__) || defined(_TMS320C6X)
-# define ARCHITECTURE_ID "TMS320C6x"
-
-# else /* unknown architecture */
-# define ARCHITECTURE_ID ""
-# endif
-
-# elif defined(__ADSPSHARC__)
-# define ARCHITECTURE_ID "SHARC"
-
-# elif defined(__ADSPBLACKFIN__)
-# define ARCHITECTURE_ID "Blackfin"
-
-#elif defined(__TASKING__)
-
-# if defined(__CTC__) || defined(__CPTC__)
-# define ARCHITECTURE_ID "TriCore"
-
-# elif defined(__CMCS__)
-# define ARCHITECTURE_ID "MCS"
-
-# elif defined(__CARM__)
-# define ARCHITECTURE_ID "ARM"
-
-# elif defined(__CARC__)
-# define ARCHITECTURE_ID "ARC"
-
-# elif defined(__C51__)
-# define ARCHITECTURE_ID "8051"
-
-# elif defined(__CPCP__)
-# define ARCHITECTURE_ID "PCP"
-
-# else
-# define ARCHITECTURE_ID ""
-# endif
-
-#else
-# define ARCHITECTURE_ID
-#endif
-
-/* Convert integer to decimal digit literals. */
-#define DEC(n) \
- ('0' + (((n) / 10000000)%10)), \
- ('0' + (((n) / 1000000)%10)), \
- ('0' + (((n) / 100000)%10)), \
- ('0' + (((n) / 10000)%10)), \
- ('0' + (((n) / 1000)%10)), \
- ('0' + (((n) / 100)%10)), \
- ('0' + (((n) / 10)%10)), \
- ('0' + ((n) % 10))
-
-/* Convert integer to hex digit literals. */
-#define HEX(n) \
- ('0' + ((n)>>28 & 0xF)), \
- ('0' + ((n)>>24 & 0xF)), \
- ('0' + ((n)>>20 & 0xF)), \
- ('0' + ((n)>>16 & 0xF)), \
- ('0' + ((n)>>12 & 0xF)), \
- ('0' + ((n)>>8 & 0xF)), \
- ('0' + ((n)>>4 & 0xF)), \
- ('0' + ((n) & 0xF))
-
-/* Construct a string literal encoding the version number. */
-#ifdef COMPILER_VERSION
-char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]";
-
-/* Construct a string literal encoding the version number components. */
-#elif defined(COMPILER_VERSION_MAJOR)
-char const info_version[] = {
- 'I', 'N', 'F', 'O', ':',
- 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
- COMPILER_VERSION_MAJOR,
-# ifdef COMPILER_VERSION_MINOR
- '.', COMPILER_VERSION_MINOR,
-# ifdef COMPILER_VERSION_PATCH
- '.', COMPILER_VERSION_PATCH,
-# ifdef COMPILER_VERSION_TWEAK
- '.', COMPILER_VERSION_TWEAK,
-# endif
-# endif
-# endif
- ']','\0'};
-#endif
-
-/* Construct a string literal encoding the internal version number. */
-#ifdef COMPILER_VERSION_INTERNAL
-char const info_version_internal[] = {
- 'I', 'N', 'F', 'O', ':',
- 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
- 'i','n','t','e','r','n','a','l','[',
- COMPILER_VERSION_INTERNAL,']','\0'};
-#elif defined(COMPILER_VERSION_INTERNAL_STR)
-char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]";
-#endif
-
-/* Construct a string literal encoding the version number components. */
-#ifdef SIMULATE_VERSION_MAJOR
-char const info_simulate_version[] = {
- 'I', 'N', 'F', 'O', ':',
- 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
- SIMULATE_VERSION_MAJOR,
-# ifdef SIMULATE_VERSION_MINOR
- '.', SIMULATE_VERSION_MINOR,
-# ifdef SIMULATE_VERSION_PATCH
- '.', SIMULATE_VERSION_PATCH,
-# ifdef SIMULATE_VERSION_TWEAK
- '.', SIMULATE_VERSION_TWEAK,
-# endif
-# endif
-# endif
- ']','\0'};
-#endif
-
-/* Construct the string literal in pieces to prevent the source from
- getting matched. Store it in a pointer rather than an array
- because some compilers will just produce instructions to fill the
- array rather than assigning a pointer to a static array. */
-char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
-char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
-
-
-
-#define C_STD_99 199901L
-#define C_STD_11 201112L
-#define C_STD_17 201710L
-#define C_STD_23 202311L
-
-#ifdef __STDC_VERSION__
-# define C_STD __STDC_VERSION__
-#endif
-
-#if !defined(__STDC__) && !defined(__clang__)
-# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__)
-# define C_VERSION "90"
-# else
-# define C_VERSION
-# endif
-#elif C_STD > C_STD_17
-# define C_VERSION "23"
-#elif C_STD > C_STD_11
-# define C_VERSION "17"
-#elif C_STD > C_STD_99
-# define C_VERSION "11"
-#elif C_STD >= C_STD_99
-# define C_VERSION "99"
-#else
-# define C_VERSION "90"
-#endif
-const char* info_language_standard_default =
- "INFO" ":" "standard_default[" C_VERSION "]";
-
-const char* info_language_extensions_default = "INFO" ":" "extensions_default["
-#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
- defined(__TI_COMPILER_VERSION__)) && \
- !defined(__STRICT_ANSI__)
- "ON"
-#else
- "OFF"
-#endif
-"]";
-
-/*--------------------------------------------------------------------------*/
-
-#ifdef ID_VOID_MAIN
-void main() {}
-#else
-# if defined(__CLASSIC_C__)
-int main(argc, argv) int argc; char *argv[];
-# else
-int main(int argc, char* argv[])
-# endif
-{
- int require = 0;
- require += info_compiler[argc];
- require += info_platform[argc];
- require += info_arch[argc];
-#ifdef COMPILER_VERSION_MAJOR
- require += info_version[argc];
-#endif
-#ifdef COMPILER_VERSION_INTERNAL
- require += info_version_internal[argc];
-#endif
-#ifdef SIMULATE_ID
- require += info_simulate[argc];
-#endif
-#ifdef SIMULATE_VERSION_MAJOR
- require += info_simulate_version[argc];
-#endif
-#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
- require += info_cray[argc];
-#endif
- require += info_language_standard_default[argc];
- require += info_language_extensions_default[argc];
- (void)argv;
- return require;
-}
-#endif
+++ /dev/null
-/* This source file must have a .cpp extension so that all C++ compilers
- recognize the extension without flags. Borland does not know .cxx for
- example. */
-#ifndef __cplusplus
-# error "A C compiler has been selected for C++."
-#endif
-
-#if !defined(__has_include)
-/* If the compiler does not have __has_include, pretend the answer is
- always no. */
-# define __has_include(x) 0
-#endif
-
-
-/* Version number components: V=Version, R=Revision, P=Patch
- Version date components: YYYY=Year, MM=Month, DD=Day */
-
-#if defined(__INTEL_COMPILER) || defined(__ICC)
-# define COMPILER_ID "Intel"
-# if defined(_MSC_VER)
-# define SIMULATE_ID "MSVC"
-# endif
-# if defined(__GNUC__)
-# define SIMULATE_ID "GNU"
-# endif
- /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later,
- except that a few beta releases use the old format with V=2021. */
-# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111
-# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
-# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
-# if defined(__INTEL_COMPILER_UPDATE)
-# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
-# else
-# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
-# endif
-# else
-# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER)
-# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE)
- /* The third version component from --version is an update index,
- but no macro is provided for it. */
-# define COMPILER_VERSION_PATCH DEC(0)
-# endif
-# if defined(__INTEL_COMPILER_BUILD_DATE)
- /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
-# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
-# endif
-# if defined(_MSC_VER)
- /* _MSC_VER = VVRR */
-# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
-# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
-# endif
-# if defined(__GNUC__)
-# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
-# elif defined(__GNUG__)
-# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
-# endif
-# if defined(__GNUC_MINOR__)
-# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
-# endif
-# if defined(__GNUC_PATCHLEVEL__)
-# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
-# endif
-
-#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER)
-# define COMPILER_ID "IntelLLVM"
-#if defined(_MSC_VER)
-# define SIMULATE_ID "MSVC"
-#endif
-#if defined(__GNUC__)
-# define SIMULATE_ID "GNU"
-#endif
-/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and
- * later. Look for 6 digit vs. 8 digit version number to decide encoding.
- * VVVV is no smaller than the current year when a version is released.
- */
-#if __INTEL_LLVM_COMPILER < 1000000L
-# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100)
-# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10)
-# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10)
-#else
-# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000)
-# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100)
-# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100)
-#endif
-#if defined(_MSC_VER)
- /* _MSC_VER = VVRR */
-# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
-# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
-#endif
-#if defined(__GNUC__)
-# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
-#elif defined(__GNUG__)
-# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
-#endif
-#if defined(__GNUC_MINOR__)
-# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
-#endif
-#if defined(__GNUC_PATCHLEVEL__)
-# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
-#endif
-
-#elif defined(__PATHCC__)
-# define COMPILER_ID "PathScale"
-# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
-# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
-# if defined(__PATHCC_PATCHLEVEL__)
-# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
-# endif
-
-#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
-# define COMPILER_ID "Embarcadero"
-# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
-# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
-# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
-
-#elif defined(__BORLANDC__)
-# define COMPILER_ID "Borland"
- /* __BORLANDC__ = 0xVRR */
-# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
-# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
-
-#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
-# define COMPILER_ID "Watcom"
- /* __WATCOMC__ = VVRR */
-# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
-# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
-# if (__WATCOMC__ % 10) > 0
-# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
-# endif
-
-#elif defined(__WATCOMC__)
-# define COMPILER_ID "OpenWatcom"
- /* __WATCOMC__ = VVRP + 1100 */
-# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
-# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
-# if (__WATCOMC__ % 10) > 0
-# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
-# endif
-
-#elif defined(__SUNPRO_CC)
-# define COMPILER_ID "SunPro"
-# if __SUNPRO_CC >= 0x5100
- /* __SUNPRO_CC = 0xVRRP */
-# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
-# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
-# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
-# else
- /* __SUNPRO_CC = 0xVRP */
-# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
-# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
-# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
-# endif
-
-#elif defined(__HP_aCC)
-# define COMPILER_ID "HP"
- /* __HP_aCC = VVRRPP */
-# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
-# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
-# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)
-
-#elif defined(__DECCXX)
-# define COMPILER_ID "Compaq"
- /* __DECCXX_VER = VVRRTPPPP */
-# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
-# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100)
-# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)
-
-#elif defined(__IBMCPP__) && defined(__COMPILER_VER__)
-# define COMPILER_ID "zOS"
- /* __IBMCPP__ = VRP */
-# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
-# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
-# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
-
-#elif defined(__open_xl__) && defined(__clang__)
-# define COMPILER_ID "IBMClang"
-# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__)
-# define COMPILER_VERSION_MINOR DEC(__open_xl_release__)
-# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__)
-# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__)
-
-
-#elif defined(__ibmxl__) && defined(__clang__)
-# define COMPILER_ID "XLClang"
-# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
-# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
-# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
-# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
-
-
-#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800
-# define COMPILER_ID "XL"
- /* __IBMCPP__ = VRP */
-# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
-# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
-# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
-
-#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800
-# define COMPILER_ID "VisualAge"
- /* __IBMCPP__ = VRP */
-# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
-# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
-# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
-
-#elif defined(__NVCOMPILER)
-# define COMPILER_ID "NVHPC"
-# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__)
-# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__)
-# if defined(__NVCOMPILER_PATCHLEVEL__)
-# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__)
-# endif
-
-#elif defined(__PGI)
-# define COMPILER_ID "PGI"
-# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
-# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
-# if defined(__PGIC_PATCHLEVEL__)
-# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
-# endif
-
-#elif defined(__clang__) && defined(__cray__)
-# define COMPILER_ID "CrayClang"
-# define COMPILER_VERSION_MAJOR DEC(__cray_major__)
-# define COMPILER_VERSION_MINOR DEC(__cray_minor__)
-# define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__)
-# define COMPILER_VERSION_INTERNAL_STR __clang_version__
-
-
-#elif defined(_CRAYC)
-# define COMPILER_ID "Cray"
-# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
-# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
-
-#elif defined(__TI_COMPILER_VERSION__)
-# define COMPILER_ID "TI"
- /* __TI_COMPILER_VERSION__ = VVVRRRPPP */
-# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
-# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
-# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
-
-#elif defined(__CLANG_FUJITSU)
-# define COMPILER_ID "FujitsuClang"
-# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
-# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
-# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
-# define COMPILER_VERSION_INTERNAL_STR __clang_version__
-
-
-#elif defined(__FUJITSU)
-# define COMPILER_ID "Fujitsu"
-# if defined(__FCC_version__)
-# define COMPILER_VERSION __FCC_version__
-# elif defined(__FCC_major__)
-# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
-# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
-# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
-# endif
-# if defined(__fcc_version)
-# define COMPILER_VERSION_INTERNAL DEC(__fcc_version)
-# elif defined(__FCC_VERSION)
-# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION)
-# endif
-
-
-#elif defined(__ghs__)
-# define COMPILER_ID "GHS"
-/* __GHS_VERSION_NUMBER = VVVVRP */
-# ifdef __GHS_VERSION_NUMBER
-# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
-# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
-# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
-# endif
-
-#elif defined(__TASKING__)
-# define COMPILER_ID "Tasking"
- # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000)
- # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100)
-# define COMPILER_VERSION_INTERNAL DEC(__VERSION__)
-
-#elif defined(__ORANGEC__)
-# define COMPILER_ID "OrangeC"
-# define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__)
-# define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__)
-# define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__)
-
-#elif defined(__SCO_VERSION__)
-# define COMPILER_ID "SCO"
-
-#elif defined(__ARMCC_VERSION) && !defined(__clang__)
-# define COMPILER_ID "ARMCC"
-#if __ARMCC_VERSION >= 1000000
- /* __ARMCC_VERSION = VRRPPPP */
- # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
- # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
- # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
-#else
- /* __ARMCC_VERSION = VRPPPP */
- # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
- # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
- # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
-#endif
-
-
-#elif defined(__clang__) && defined(__apple_build_version__)
-# define COMPILER_ID "AppleClang"
-# if defined(_MSC_VER)
-# define SIMULATE_ID "MSVC"
-# endif
-# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
-# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
-# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
-# if defined(_MSC_VER)
- /* _MSC_VER = VVRR */
-# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
-# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
-# endif
-# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
-
-#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
-# define COMPILER_ID "ARMClang"
- # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
- # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
- # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100)
-# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
-
-#elif defined(__clang__) && defined(__ti__)
-# define COMPILER_ID "TIClang"
- # define COMPILER_VERSION_MAJOR DEC(__ti_major__)
- # define COMPILER_VERSION_MINOR DEC(__ti_minor__)
- # define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__)
-# define COMPILER_VERSION_INTERNAL DEC(__ti_version__)
-
-#elif defined(__clang__)
-# define COMPILER_ID "Clang"
-# if defined(_MSC_VER)
-# define SIMULATE_ID "MSVC"
-# endif
-# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
-# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
-# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
-# if defined(_MSC_VER)
- /* _MSC_VER = VVRR */
-# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
-# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
-# endif
-
-#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__))
-# define COMPILER_ID "LCC"
-# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100)
-# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100)
-# if defined(__LCC_MINOR__)
-# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__)
-# endif
-# if defined(__GNUC__) && defined(__GNUC_MINOR__)
-# define SIMULATE_ID "GNU"
-# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
-# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
-# if defined(__GNUC_PATCHLEVEL__)
-# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
-# endif
-# endif
-
-#elif defined(__GNUC__) || defined(__GNUG__)
-# define COMPILER_ID "GNU"
-# if defined(__GNUC__)
-# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
-# else
-# define COMPILER_VERSION_MAJOR DEC(__GNUG__)
-# endif
-# if defined(__GNUC_MINOR__)
-# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
-# endif
-# if defined(__GNUC_PATCHLEVEL__)
-# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
-# endif
-
-#elif defined(_MSC_VER)
-# define COMPILER_ID "MSVC"
- /* _MSC_VER = VVRR */
-# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
-# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
-# if defined(_MSC_FULL_VER)
-# if _MSC_VER >= 1400
- /* _MSC_FULL_VER = VVRRPPPPP */
-# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
-# else
- /* _MSC_FULL_VER = VVRRPPPP */
-# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
-# endif
-# endif
-# if defined(_MSC_BUILD)
-# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
-# endif
-
-#elif defined(_ADI_COMPILER)
-# define COMPILER_ID "ADSP"
-#if defined(__VERSIONNUM__)
- /* __VERSIONNUM__ = 0xVVRRPPTT */
-# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF)
-# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF)
-# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF)
-# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF)
-#endif
-
-#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
-# define COMPILER_ID "IAR"
-# if defined(__VER__) && defined(__ICCARM__)
-# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
-# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
-# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
-# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
-# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__))
-# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
-# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
-# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
-# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
-# endif
-
-
-/* These compilers are either not known or too old to define an
- identification macro. Try to identify the platform and guess that
- it is the native compiler. */
-#elif defined(__hpux) || defined(__hpua)
-# define COMPILER_ID "HP"
-
-#else /* unknown compiler */
-# define COMPILER_ID ""
-#endif
-
-/* Construct the string literal in pieces to prevent the source from
- getting matched. Store it in a pointer rather than an array
- because some compilers will just produce instructions to fill the
- array rather than assigning a pointer to a static array. */
-char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
-#ifdef SIMULATE_ID
-char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
-#endif
-
-#ifdef __QNXNTO__
-char const* qnxnto = "INFO" ":" "qnxnto[]";
-#endif
-
-#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
-char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
-#endif
-
-#define STRINGIFY_HELPER(X) #X
-#define STRINGIFY(X) STRINGIFY_HELPER(X)
-
-/* Identify known platforms by name. */
-#if defined(__linux) || defined(__linux__) || defined(linux)
-# define PLATFORM_ID "Linux"
-
-#elif defined(__MSYS__)
-# define PLATFORM_ID "MSYS"
-
-#elif defined(__CYGWIN__)
-# define PLATFORM_ID "Cygwin"
-
-#elif defined(__MINGW32__)
-# define PLATFORM_ID "MinGW"
-
-#elif defined(__APPLE__)
-# define PLATFORM_ID "Darwin"
-
-#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
-# define PLATFORM_ID "Windows"
-
-#elif defined(__FreeBSD__) || defined(__FreeBSD)
-# define PLATFORM_ID "FreeBSD"
-
-#elif defined(__NetBSD__) || defined(__NetBSD)
-# define PLATFORM_ID "NetBSD"
-
-#elif defined(__OpenBSD__) || defined(__OPENBSD)
-# define PLATFORM_ID "OpenBSD"
-
-#elif defined(__sun) || defined(sun)
-# define PLATFORM_ID "SunOS"
-
-#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
-# define PLATFORM_ID "AIX"
-
-#elif defined(__hpux) || defined(__hpux__)
-# define PLATFORM_ID "HP-UX"
-
-#elif defined(__HAIKU__)
-# define PLATFORM_ID "Haiku"
-
-#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
-# define PLATFORM_ID "BeOS"
-
-#elif defined(__QNX__) || defined(__QNXNTO__)
-# define PLATFORM_ID "QNX"
-
-#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
-# define PLATFORM_ID "Tru64"
-
-#elif defined(__riscos) || defined(__riscos__)
-# define PLATFORM_ID "RISCos"
-
-#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
-# define PLATFORM_ID "SINIX"
-
-#elif defined(__UNIX_SV__)
-# define PLATFORM_ID "UNIX_SV"
-
-#elif defined(__bsdos__)
-# define PLATFORM_ID "BSDOS"
-
-#elif defined(_MPRAS) || defined(MPRAS)
-# define PLATFORM_ID "MP-RAS"
-
-#elif defined(__osf) || defined(__osf__)
-# define PLATFORM_ID "OSF1"
-
-#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
-# define PLATFORM_ID "SCO_SV"
-
-#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
-# define PLATFORM_ID "ULTRIX"
-
-#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
-# define PLATFORM_ID "Xenix"
-
-#elif defined(__WATCOMC__)
-# if defined(__LINUX__)
-# define PLATFORM_ID "Linux"
-
-# elif defined(__DOS__)
-# define PLATFORM_ID "DOS"
-
-# elif defined(__OS2__)
-# define PLATFORM_ID "OS2"
-
-# elif defined(__WINDOWS__)
-# define PLATFORM_ID "Windows3x"
-
-# elif defined(__VXWORKS__)
-# define PLATFORM_ID "VxWorks"
-
-# else /* unknown platform */
-# define PLATFORM_ID
-# endif
-
-#elif defined(__INTEGRITY)
-# if defined(INT_178B)
-# define PLATFORM_ID "Integrity178"
-
-# else /* regular Integrity */
-# define PLATFORM_ID "Integrity"
-# endif
-
-# elif defined(_ADI_COMPILER)
-# define PLATFORM_ID "ADSP"
-
-#else /* unknown platform */
-# define PLATFORM_ID
-
-#endif
-
-/* For windows compilers MSVC and Intel we can determine
- the architecture of the compiler being used. This is because
- the compilers do not have flags that can change the architecture,
- but rather depend on which compiler is being used
-*/
-#if defined(_WIN32) && defined(_MSC_VER)
-# if defined(_M_IA64)
-# define ARCHITECTURE_ID "IA64"
-
-# elif defined(_M_ARM64EC)
-# define ARCHITECTURE_ID "ARM64EC"
-
-# elif defined(_M_X64) || defined(_M_AMD64)
-# define ARCHITECTURE_ID "x64"
-
-# elif defined(_M_IX86)
-# define ARCHITECTURE_ID "X86"
-
-# elif defined(_M_ARM64)
-# define ARCHITECTURE_ID "ARM64"
-
-# elif defined(_M_ARM)
-# if _M_ARM == 4
-# define ARCHITECTURE_ID "ARMV4I"
-# elif _M_ARM == 5
-# define ARCHITECTURE_ID "ARMV5I"
-# else
-# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
-# endif
-
-# elif defined(_M_MIPS)
-# define ARCHITECTURE_ID "MIPS"
-
-# elif defined(_M_SH)
-# define ARCHITECTURE_ID "SHx"
-
-# else /* unknown architecture */
-# define ARCHITECTURE_ID ""
-# endif
-
-#elif defined(__WATCOMC__)
-# if defined(_M_I86)
-# define ARCHITECTURE_ID "I86"
-
-# elif defined(_M_IX86)
-# define ARCHITECTURE_ID "X86"
-
-# else /* unknown architecture */
-# define ARCHITECTURE_ID ""
-# endif
-
-#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
-# if defined(__ICCARM__)
-# define ARCHITECTURE_ID "ARM"
-
-# elif defined(__ICCRX__)
-# define ARCHITECTURE_ID "RX"
-
-# elif defined(__ICCRH850__)
-# define ARCHITECTURE_ID "RH850"
-
-# elif defined(__ICCRL78__)
-# define ARCHITECTURE_ID "RL78"
-
-# elif defined(__ICCRISCV__)
-# define ARCHITECTURE_ID "RISCV"
-
-# elif defined(__ICCAVR__)
-# define ARCHITECTURE_ID "AVR"
-
-# elif defined(__ICC430__)
-# define ARCHITECTURE_ID "MSP430"
-
-# elif defined(__ICCV850__)
-# define ARCHITECTURE_ID "V850"
-
-# elif defined(__ICC8051__)
-# define ARCHITECTURE_ID "8051"
-
-# elif defined(__ICCSTM8__)
-# define ARCHITECTURE_ID "STM8"
-
-# else /* unknown architecture */
-# define ARCHITECTURE_ID ""
-# endif
-
-#elif defined(__ghs__)
-# if defined(__PPC64__)
-# define ARCHITECTURE_ID "PPC64"
-
-# elif defined(__ppc__)
-# define ARCHITECTURE_ID "PPC"
-
-# elif defined(__ARM__)
-# define ARCHITECTURE_ID "ARM"
-
-# elif defined(__x86_64__)
-# define ARCHITECTURE_ID "x64"
-
-# elif defined(__i386__)
-# define ARCHITECTURE_ID "X86"
-
-# else /* unknown architecture */
-# define ARCHITECTURE_ID ""
-# endif
-
-#elif defined(__clang__) && defined(__ti__)
-# if defined(__ARM_ARCH)
-# define ARCHITECTURE_ID "Arm"
-
-# else /* unknown architecture */
-# define ARCHITECTURE_ID ""
-# endif
-
-#elif defined(__TI_COMPILER_VERSION__)
-# if defined(__TI_ARM__)
-# define ARCHITECTURE_ID "ARM"
-
-# elif defined(__MSP430__)
-# define ARCHITECTURE_ID "MSP430"
-
-# elif defined(__TMS320C28XX__)
-# define ARCHITECTURE_ID "TMS320C28x"
-
-# elif defined(__TMS320C6X__) || defined(_TMS320C6X)
-# define ARCHITECTURE_ID "TMS320C6x"
-
-# else /* unknown architecture */
-# define ARCHITECTURE_ID ""
-# endif
-
-# elif defined(__ADSPSHARC__)
-# define ARCHITECTURE_ID "SHARC"
-
-# elif defined(__ADSPBLACKFIN__)
-# define ARCHITECTURE_ID "Blackfin"
-
-#elif defined(__TASKING__)
-
-# if defined(__CTC__) || defined(__CPTC__)
-# define ARCHITECTURE_ID "TriCore"
-
-# elif defined(__CMCS__)
-# define ARCHITECTURE_ID "MCS"
-
-# elif defined(__CARM__)
-# define ARCHITECTURE_ID "ARM"
-
-# elif defined(__CARC__)
-# define ARCHITECTURE_ID "ARC"
-
-# elif defined(__C51__)
-# define ARCHITECTURE_ID "8051"
-
-# elif defined(__CPCP__)
-# define ARCHITECTURE_ID "PCP"
-
-# else
-# define ARCHITECTURE_ID ""
-# endif
-
-#else
-# define ARCHITECTURE_ID
-#endif
-
-/* Convert integer to decimal digit literals. */
-#define DEC(n) \
- ('0' + (((n) / 10000000)%10)), \
- ('0' + (((n) / 1000000)%10)), \
- ('0' + (((n) / 100000)%10)), \
- ('0' + (((n) / 10000)%10)), \
- ('0' + (((n) / 1000)%10)), \
- ('0' + (((n) / 100)%10)), \
- ('0' + (((n) / 10)%10)), \
- ('0' + ((n) % 10))
-
-/* Convert integer to hex digit literals. */
-#define HEX(n) \
- ('0' + ((n)>>28 & 0xF)), \
- ('0' + ((n)>>24 & 0xF)), \
- ('0' + ((n)>>20 & 0xF)), \
- ('0' + ((n)>>16 & 0xF)), \
- ('0' + ((n)>>12 & 0xF)), \
- ('0' + ((n)>>8 & 0xF)), \
- ('0' + ((n)>>4 & 0xF)), \
- ('0' + ((n) & 0xF))
-
-/* Construct a string literal encoding the version number. */
-#ifdef COMPILER_VERSION
-char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]";
-
-/* Construct a string literal encoding the version number components. */
-#elif defined(COMPILER_VERSION_MAJOR)
-char const info_version[] = {
- 'I', 'N', 'F', 'O', ':',
- 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
- COMPILER_VERSION_MAJOR,
-# ifdef COMPILER_VERSION_MINOR
- '.', COMPILER_VERSION_MINOR,
-# ifdef COMPILER_VERSION_PATCH
- '.', COMPILER_VERSION_PATCH,
-# ifdef COMPILER_VERSION_TWEAK
- '.', COMPILER_VERSION_TWEAK,
-# endif
-# endif
-# endif
- ']','\0'};
-#endif
-
-/* Construct a string literal encoding the internal version number. */
-#ifdef COMPILER_VERSION_INTERNAL
-char const info_version_internal[] = {
- 'I', 'N', 'F', 'O', ':',
- 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
- 'i','n','t','e','r','n','a','l','[',
- COMPILER_VERSION_INTERNAL,']','\0'};
-#elif defined(COMPILER_VERSION_INTERNAL_STR)
-char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]";
-#endif
-
-/* Construct a string literal encoding the version number components. */
-#ifdef SIMULATE_VERSION_MAJOR
-char const info_simulate_version[] = {
- 'I', 'N', 'F', 'O', ':',
- 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
- SIMULATE_VERSION_MAJOR,
-# ifdef SIMULATE_VERSION_MINOR
- '.', SIMULATE_VERSION_MINOR,
-# ifdef SIMULATE_VERSION_PATCH
- '.', SIMULATE_VERSION_PATCH,
-# ifdef SIMULATE_VERSION_TWEAK
- '.', SIMULATE_VERSION_TWEAK,
-# endif
-# endif
-# endif
- ']','\0'};
-#endif
-
-/* Construct the string literal in pieces to prevent the source from
- getting matched. Store it in a pointer rather than an array
- because some compilers will just produce instructions to fill the
- array rather than assigning a pointer to a static array. */
-char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
-char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
-
-
-
-#define CXX_STD_98 199711L
-#define CXX_STD_11 201103L
-#define CXX_STD_14 201402L
-#define CXX_STD_17 201703L
-#define CXX_STD_20 202002L
-#define CXX_STD_23 202302L
-
-#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG)
-# if _MSVC_LANG > CXX_STD_17
-# define CXX_STD _MSVC_LANG
-# elif _MSVC_LANG == CXX_STD_17 && defined(__cpp_aggregate_paren_init)
-# define CXX_STD CXX_STD_20
-# elif _MSVC_LANG > CXX_STD_14 && __cplusplus > CXX_STD_17
-# define CXX_STD CXX_STD_20
-# elif _MSVC_LANG > CXX_STD_14
-# define CXX_STD CXX_STD_17
-# elif defined(__INTEL_CXX11_MODE__) && defined(__cpp_aggregate_nsdmi)
-# define CXX_STD CXX_STD_14
-# elif defined(__INTEL_CXX11_MODE__)
-# define CXX_STD CXX_STD_11
-# else
-# define CXX_STD CXX_STD_98
-# endif
-#elif defined(_MSC_VER) && defined(_MSVC_LANG)
-# if _MSVC_LANG > __cplusplus
-# define CXX_STD _MSVC_LANG
-# else
-# define CXX_STD __cplusplus
-# endif
-#elif defined(__NVCOMPILER)
-# if __cplusplus == CXX_STD_17 && defined(__cpp_aggregate_paren_init)
-# define CXX_STD CXX_STD_20
-# else
-# define CXX_STD __cplusplus
-# endif
-#elif defined(__INTEL_COMPILER) || defined(__PGI)
-# if __cplusplus == CXX_STD_11 && defined(__cpp_namespace_attributes)
-# define CXX_STD CXX_STD_17
-# elif __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi)
-# define CXX_STD CXX_STD_14
-# else
-# define CXX_STD __cplusplus
-# endif
-#elif (defined(__IBMCPP__) || defined(__ibmxl__)) && defined(__linux__)
-# if __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi)
-# define CXX_STD CXX_STD_14
-# else
-# define CXX_STD __cplusplus
-# endif
-#elif __cplusplus == 1 && defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define CXX_STD CXX_STD_11
-#else
-# define CXX_STD __cplusplus
-#endif
-
-const char* info_language_standard_default = "INFO" ":" "standard_default["
-#if CXX_STD > CXX_STD_23
- "26"
-#elif CXX_STD > CXX_STD_20
- "23"
-#elif CXX_STD > CXX_STD_17
- "20"
-#elif CXX_STD > CXX_STD_14
- "17"
-#elif CXX_STD > CXX_STD_11
- "14"
-#elif CXX_STD >= CXX_STD_11
- "11"
-#else
- "98"
-#endif
-"]";
-
-const char* info_language_extensions_default = "INFO" ":" "extensions_default["
-#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
- defined(__TI_COMPILER_VERSION__)) && \
- !defined(__STRICT_ANSI__)
- "ON"
-#else
- "OFF"
-#endif
-"]";
-
-/*--------------------------------------------------------------------------*/
-
-int main(int argc, char* argv[])
-{
- int require = 0;
- require += info_compiler[argc];
- require += info_platform[argc];
- require += info_arch[argc];
-#ifdef COMPILER_VERSION_MAJOR
- require += info_version[argc];
-#endif
-#ifdef COMPILER_VERSION_INTERNAL
- require += info_version_internal[argc];
-#endif
-#ifdef SIMULATE_ID
- require += info_simulate[argc];
-#endif
-#ifdef SIMULATE_VERSION_MAJOR
- require += info_simulate_version[argc];
-#endif
-#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
- require += info_cray[argc];
-#endif
- require += info_language_standard_default[argc];
- require += info_language_extensions_default[argc];
- (void)argv;
- return require;
-}
--- /dev/null
+/******************************************************************************/
+/* */
+/* Copyright 2023 by AICXTEK TECHNOLOGIES CO.,LTD. All rights reserved. */
+/* */
+/******************************************************************************/
+
+/**
+ * DESCRIPTION
+ *
+ * This file entry demo apps without GUI for aicos
+ */
+#define AIC_THIS_FILE 0x888888
+#include <aic_errno.h>
+#include <aic_init.h>
+#include <aic_osa_ex.h>
+#include <aos_thread.h>
+#include "app_msg.h"
+#include "aic_net_pdp_mgr.h"
+#include "aic_websocket_client.h"
+#include "cJSON.h"
+#include <serial_inc.h>
+#include "aic_osa.h"
+#include "app_audio.h"
+#include "helios_ringbuf.h"
+#include "bk_websocket.h"
+#define ai_VC_task_priority 35
+static aos_thread_id AI_AMP_task_id = 0;
+static aos_queue_ptr AI_AMP_task_queue = NULL;
+static u32 AI_VC_client_websocket_handle = 0;
+static u32* ai_uart_handle;
+static aos_thread_id AI_VC_send_task_id = 0;
+static aos_thread_id AI_VC_read_task_id = 0;
+static aos_queue_ptr AI_VC_send_queue = NULL;
+static aos_thread_id AI_VC_play_task_id = 0;
+static aos_queue_ptr AI_VC_play_queue = NULL;
+static aos_thread_id AI_VC_record_task_id = 0;
+static aos_queue_ptr AI_VC_record_tmp_queue = NULL;
+WebSocketClient *AI_client_VC = NULL;
+static u32 close_timerout = 0;
+char *AI_TTS_str = NULL;
+static aos_timer_ptr AI_VC_1S_timer = NULL;
+typedef enum AI_AMP_MSG
+{
+ VC_START,
+ VC_PLAY_START,
+ VC_PLAY_END,
+ VC_RECORD_START,
+ VC_RECORD_END,
+ VC_Cancel,//打断取消
+ VC_CLOSE,
+ VC_CONNECT_ERROR,
+} AI_AMP_MSG_Type;
+typedef struct
+{
+ char *data;
+ u32 len;
+ AI_AMP_MSG_Type MSG_Type;
+}AI_AMP_MSG_queue_t;
+typedef enum
+{
+ VC_State_None=0,
+ VC_State_Listening=1,//#听
+ VC_State_SpeechStart=2,//#说开始
+ VC_State_SpeechIng=3,//#正在说
+ VC_State_SpeechEnd=4,//#说结束
+ VC_State_RequestToRespond=5 ,//#TTS请求或者chat请求
+ VC_State_Thinking=6,//#想(chat)
+ VC_State_Responding=7,//#音频播放
+ VC_State_TTSStart=8,
+ VC_State_TTSData=9,
+ VC_State_TTSFinish=10,
+ VC_State_TTSEnd=11,
+ VC_State_TTSError=12,
+ VC_State_DialogError=13,
+ VC_State_End=14,
+}VC_state_type;
+VC_state_type VC_state = VC_State_None;
+// #define APP_CFG_TASK_STK_SIZE (4096u)
+// #define APP_CFG_TASK_COM_PRIO (35u)
+// typedef int32_t (*srv_func_callback)(void *p_param, uint32_t size); // TODO: temp and common define this
+typedef struct
+{
+ char *data;
+ u32 len;
+ u8 AIC_WEBSOCKET_OPCODE;
+}AI_VC_send_queue_t;
+typedef struct
+{
+ char *data;
+ u32 len;
+}AI_VC_audio_queue_t;
+static aos_status AI_AMP_MSG_put(char *data,u32 len,AI_AMP_MSG_Type MSG_Type);
+static void AI_VC_send_satrt(void);
+static aos_status AI_VC_send_data(char *data,u32 len,u8 AIC_WEBSOCKET_OPCODE);
+void AI_VC_start(void);
+void AI_VC_Close(void);
+static void AI_VC_send_task(void *thread_input);//websocket 发送线程
+static void AI_VC_read_task(void *thread_input);//websocket 读线程
+static void AI_VC_put_play_data(char *data,u32 len);//音频数据入队播放
+//关闭录音
+void VC_record_End(void);
+//打开录音
+void VC_record_Start(void);
+
+//连接websocket
+static int websocket_connect_VC(void);
+static void websocket_deconnect_VC(void);
+
+int play_data_len = 0;
+//关闭音频播放
+void VC_Play_End(void);
+//打开音频播放
+void VC_Play_Start(void);
+int bk_printf(const char *format, ...)
+{
+ int ret=0;
+ int bk_printf_count = 3*2048;
+ va_list args;
+ char *out = NULL;
+ out = aic_zalloc(bk_printf_count);
+ if(!out)
+ {
+ uart_write(ai_uart_handle,"bk_printf ERROR!!!!!\r\n", strlen("bk_printf ERROR!!!!!\r\n"));
+ return 0;
+ }
+ va_start( args, format );
+ ret = vsnprintf(out, bk_printf_count, format, args);
+ memcpy(out+ret,"\r\n",2);
+ ret+=2;
+ uart_write(ai_uart_handle,out, ret);
+
+ //aos_sleep(100);
+ va_end( args );
+ aic_free(out);
+ return ret;
+}
+#define count_len 50
+void print_long_log(u8 *data,int data_len)
+{
+ uart_write(ai_uart_handle,data, data_len);
+
+}
+void bk_print_hex(u8 *data,int data_len)
+{
+ char tmp[5]= {0};
+ int tmp_len = 0;
+ for(int i = 0;i<data_len;i++)
+ {
+ tmp_len = snprintf(tmp,sizeof(tmp),"%02X ",data[i]);
+ uart_write(ai_uart_handle,tmp, tmp_len);
+ }
+ uart_write(ai_uart_handle,"\r\n", 2);
+}
+//发送tts播放接口
+static void AI_client_VC_synthesis(char *str)
+{
+ // 创建根对象
+ cJSON *root = cJSON_CreateObject();
+ if (root == NULL) {
+ bk_printf("Failed to create root object.\n");
+ return ;
+ }
+
+ // 设置 "event" 字段
+ cJSON_AddStringToObject(root, "event", "synthesis");
+
+ // 创建 "payload" 对象
+ cJSON *payload = cJSON_CreateObject();
+ if (payload == NULL) {
+ bk_printf("Failed to create payload object.\n");
+ cJSON_Delete(root);
+ return ;
+ }
+
+ // 设置 "payload" 中的 "text" 字段
+ cJSON_AddStringToObject(payload, "text", str);
+
+ // 将 "payload" 对象添加到根对象中
+ cJSON_AddItemToObject(root, "payload", payload);
+
+ // 将 JSON 对象转换为字符串
+ char *json_str = cJSON_Print(root);
+ if (json_str == NULL) {
+ bk_printf("Failed to print JSON object.\n");
+ cJSON_Delete(root);
+
+ }
+ AI_VC_send_data(json_str,strlen(json_str),AIC_WEBSOCKET_OPCODE_TEXT_FRAME);//发送数据
+ // 输出 JSON 字符串
+ bk_printf("%s\n", json_str);
+
+ // 释放内存
+ free(json_str);
+ cJSON_Delete(root);
+}
+static void AI_VC_send_satrt(void)
+{
+ // 创建根对象
+ cJSON *root = cJSON_CreateObject();
+ cJSON_AddStringToObject(root, "event", "start");
+
+ // 创建 payload 对象
+ cJSON *payload = cJSON_CreateObject();
+ cJSON_AddStringToObject(payload, "device_id", "125698745641");
+ cJSON_AddStringToObject(payload, "user_agent", "AudioClient/1.0");
+
+ // 创建 dialog_attributes 对象
+ cJSON *dialog_attributes = cJSON_CreateObject();
+ cJSON_AddStringToObject(dialog_attributes, "provider", "coze");
+
+ // 创建 dialog_attributes 下的 cfg 对象
+ cJSON *dialog_cfg = cJSON_CreateObject();
+ cJSON_AddBoolToObject(dialog_cfg, "disable_empty_prompt", 1);
+
+ // 创建 custom_variables 对象
+ cJSON *custom_variables = cJSON_CreateObject();
+ cJSON_AddStringToObject(custom_variables, "name", "小瑞");
+ cJSON_AddItemToObject(dialog_cfg, "custom_variables", custom_variables);
+
+ // 创建 greeting 对象
+ cJSON *greeting = cJSON_CreateObject();
+ cJSON_AddBoolToObject(greeting, "enabled", FALSE);
+ cJSON_AddStringToObject(greeting, "content", "123456789123456789");
+ cJSON_AddItemToObject(dialog_cfg, "greeting", greeting);
+
+ // 创建 bot_option 对象
+ cJSON *bot_option = cJSON_CreateObject();
+ cJSON_AddBoolToObject(bot_option, "use_workflow", 1);
+ cJSON_AddStringToObject(bot_option, "bot_id", "7411071327182438412");
+ cJSON_AddStringToObject(bot_option, "workflow_id", "7469049680291610636");
+ cJSON_AddItemToObject(dialog_cfg, "bot_option", bot_option);
+
+ cJSON_AddItemToObject(dialog_attributes, "cfg", dialog_cfg);
+ cJSON_AddItemToObject(payload, "dialog_attributes", dialog_attributes);
+
+ // 创建 outbound_attributes 对象
+ cJSON *outbound_attributes = cJSON_CreateObject();
+ cJSON_AddStringToObject(outbound_attributes, "provider", "volcengine");
+
+ // 创建 outbound_attributes 下的 cfg 对象
+ cJSON *outbound_cfg = cJSON_CreateObject();
+ cJSON_AddStringToObject(outbound_cfg, "format", "pcm");
+ cJSON_AddNumberToObject(outbound_cfg, "sample_rate", 16000);
+ cJSON_AddNumberToObject(outbound_cfg, "bit_rate", 16);
+ cJSON_AddNumberToObject(outbound_cfg, "channel", 1);
+ cJSON_AddNumberToObject(outbound_cfg, "volume", 100);
+ cJSON_AddNumberToObject(outbound_cfg, "speech_rate", 0);
+ cJSON_AddNumberToObject(outbound_cfg, "chunk_interval_ms", 10);
+ cJSON_AddStringToObject(outbound_cfg, "voice", "zh_female_linjianvhai_moon_bigtts");
+ cJSON_AddItemToObject(outbound_attributes, "cfg", outbound_cfg);
+ cJSON_AddItemToObject(payload, "outbound_attributes", outbound_attributes);
+
+ // 创建 inbound_attributes 对象
+ cJSON *inbound_attributes = cJSON_CreateObject();
+ cJSON_AddStringToObject(inbound_attributes, "provider", "volcengine");
+ cJSON_AddBoolToObject(inbound_attributes, "disable_vad", 0);
+ cJSON_AddNumberToObject(inbound_attributes, "vad_silence", 400);
+
+ // 创建 interrupt_options 对象
+ cJSON *interrupt_options = cJSON_CreateObject();
+ cJSON_AddBoolToObject(interrupt_options, "concatenate_results", 1);
+ cJSON_AddBoolToObject(interrupt_options, "thinking_time_only", 1);
+ cJSON_AddBoolToObject(interrupt_options, "keyword_interrupt", 1);
+
+ // 创建 interrupt_keywords 数组
+ cJSON *interrupt_keywords = cJSON_CreateArray();
+ cJSON_AddItemToArray(interrupt_keywords, cJSON_CreateString("停止"));
+ cJSON_AddItemToArray(interrupt_keywords, cJSON_CreateString("打断"));
+ cJSON_AddItemToArray(interrupt_keywords, cJSON_CreateString("等一下"));
+ cJSON_AddItemToObject(interrupt_options, "interrupt_keywords", interrupt_keywords);
+
+ cJSON_AddItemToObject(inbound_attributes, "interrupt_options", interrupt_options);
+
+ // 创建 inbound_attributes 下的 cfg 对象
+ cJSON *inbound_cfg = cJSON_CreateObject();
+ cJSON_AddStringToObject(inbound_cfg, "format", "pcm");
+ cJSON_AddNumberToObject(inbound_cfg, "sample_rate", 16000);
+ cJSON_AddNumberToObject(inbound_cfg, "bit_rate", 16);
+ cJSON_AddNumberToObject(inbound_cfg, "channel", 1);
+ cJSON_AddBoolToObject(inbound_cfg, "enable_punctuation", 1);
+ cJSON_AddBoolToObject(inbound_cfg, "enable_itn", 1);
+ cJSON_AddItemToObject(inbound_attributes, "cfg", inbound_cfg);
+ cJSON_AddItemToObject(payload, "inbound_attributes", inbound_attributes);
+
+
+ cJSON_AddItemToObject(root, "payload", payload);
+ bk_printf("AI_VC_send_satrt!!!!!!!!!!!");
+ // 打印生成的 JSON 字符串
+ char *json_str = cJSON_Print(root);
+ if (json_str) {
+ //remove_whitespace(json_str);
+ bk_printf("json_str:%s",json_str);
+
+ AI_VC_send_data(json_str,strlen(json_str),AIC_WEBSOCKET_OPCODE_TEXT_FRAME);//发送数据
+
+ cJSON_free(json_str);
+ }
+
+ // 释放内存
+ cJSON_Delete(root);
+}
+//TTS播放
+static void VC_TTS_Play(const char *str)
+{
+ AI_TTS_str = aic_zalloc(strlen(str)+1);
+ strcpy(AI_TTS_str,str);
+ //VC_record_End();
+ VC_Play_End();
+ websocket_deconnect_VC();
+ AI_VC_start();
+}
+
+//连接websocket
+static int websocket_connect_VC(void)
+{
+ //连接服务器
+ // if(AI_VC_client_websocket_handle == 0)
+ // {
+ // aic_network_enable_pdp_nic_capdump();//打开网络调试
+ // AI_VC_client_websocket_handle = aic_websocket_client_create("AI_VC_2_5", 10*1024);
+ // app_logi("AI_AMP_2_5_task:aic_websocket_client_create :%d \n",AI_VC_client_websocket_handle);
+ // //aos_sleep(1000);
+
+ // int status = aic_websocket_client_connect(AI_VC_client_websocket_handle, "118.145.158.207", 0, 22086,
+ // "118.145.158.207", sizeof("118.145.158.207") - 1,
+ // (u8 *)"/vc/chat?is_auth=0", sizeof("/vc/chat?is_auth=0") - 1,
+ // (u8 *)"ws", sizeof("ws") - 1,
+ // NX_WAIT_FOREVER);
+ // app_logi("AI_AMP_2_5_task:aic_websocket_client_connect :%d \n",status);
+ // if(status)//连接失败
+ // {
+ // aic_websocket_delete(AI_VC_client_websocket_handle,5000);
+ // AI_VC_client_websocket_handle = 0;
+ // return -1;
+ // }
+ // }
+ if(AI_client_VC == NULL)
+ {
+ AI_client_VC = init_websocket_client("118.145.158.207","/vc/chat?is_auth=0",22082);
+ }
+ //创建发送线程
+ if(AI_VC_send_task_id == 0)
+ {
+ AI_VC_send_task_id = aos_create_thread(
+ "AI_VC_send",
+ AI_VC_send_task,
+ &AI_VC_send_task_id,
+ 4096u,
+ 0,
+ NULL,
+ ai_VC_task_priority,
+ AOS_AUTO_START);
+ }
+ //创建发送队列
+ if(AI_VC_send_queue == NULL)
+ {
+ AI_VC_send_queue = aos_create_queue("AI_VC_send_queue",
+ sizeof(AI_VC_send_queue_t),
+ 200);
+ }
+ //创建读线程
+ if(AI_VC_read_task_id == 0)
+ {
+ AI_VC_read_task_id = aos_create_thread(
+ "AI_VC_read",
+ AI_VC_read_task,
+ &AI_VC_read_task_id,
+ 4096u,
+ 0,
+ NULL,
+ ai_VC_task_priority,
+ AOS_AUTO_START);
+ }
+ return 0;
+
+}
+static void websocket_deconnect_VC(void)
+{
+ bk_printf("websocket_deconnect_VC!!!!!!!!!!!!");
+ // if(AI_VC_client_websocket_handle)//断开服务器
+ // {
+ // aic_websocket_disconnect(AI_VC_client_websocket_handle,5000);
+ // aic_websocket_delete(AI_VC_client_websocket_handle,5000);
+ // AI_VC_client_websocket_handle = 0;
+ // }
+
+ //销毁发送线程
+ if(AI_VC_send_task_id != 0)
+ {
+ aos_delete_thread(AI_VC_send_task_id);
+ AI_VC_send_task_id = 0;
+ }
+ //销毁发送队列
+ if(AI_VC_send_queue != NULL)
+ {
+ char count_t= 200;
+ AI_VC_send_queue_t AI_VC_send_queue_data_t;
+ while(count_t--)//清空队列数据
+ {
+ if(aos_recv_from_queue(AI_VC_send_queue,&AI_VC_send_queue_data_t,AOS_NO_WAIT) == AOS_SUCCESS)
+ {
+ if(AI_VC_send_queue_data_t.data)
+ aic_free(AI_VC_send_queue_data_t.data);
+ }
+ else{
+ break;
+ }
+ }
+ aos_delete_queue(AI_VC_send_queue);
+ AI_VC_send_queue = NULL;
+ }
+ //销毁读线程
+ if(AI_VC_read_task_id != 0)
+ {
+ aos_delete_thread(AI_VC_read_task_id);
+ AI_VC_read_task_id = 0;
+ }
+ if(AI_client_VC)
+ {
+ close_websocket_client(AI_client_VC);
+ AI_client_VC = NULL;
+ }
+
+}
+//websocket 发送数据,AIC_WEBSOCKET_OPCODE = AIC_WEBSOCKET_OPCODE_TEXT_FRAME发送字符串,
+//AIC_WEBSOCKET_OPCODE =AIC_WEBSOCKET_OPCODE_BINARY_FRAME发送二进制
+static aos_status AI_VC_send_data(char *data,u32 len,u8 AIC_WEBSOCKET_OPCODE)
+{
+ AI_VC_send_queue_t AI_VC_send_queue_data;
+ AI_VC_send_queue_data.data = aic_malloc(len+1);
+ memset(AI_VC_send_queue_data.data ,0,len+1);
+ if(!AI_VC_send_queue_data.data)
+ {
+ bk_printf("AI_VC_send_data aic_malloc ERROR!!!!!!!!!!");
+ return AOS_ERROR;
+ }
+ memcpy(AI_VC_send_queue_data.data,data,len);
+ AI_VC_send_queue_data.len=len;
+ AI_VC_send_queue_data.AIC_WEBSOCKET_OPCODE=AIC_WEBSOCKET_OPCODE;
+ if(AI_VC_send_queue && AOS_SUCCESS!=aos_send_to_queue(AI_VC_send_queue,&AI_VC_send_queue_data,AOS_NO_WAIT))
+ {
+
+ aic_free(AI_VC_send_queue_data.data);
+ return AOS_ERROR;
+ }
+
+ return AOS_SUCCESS;
+}
+static void AI_VC_send_task(void *thread_input)//websocket 发送线程
+{
+ AI_VC_send_queue_t AI_VC_send_queue_data;
+ bk_printf("AI_VC_send_task go......");
+
+ while(1)
+ {
+ if(aos_recv_from_queue(AI_VC_send_queue,&AI_VC_send_queue_data,AOS_WAIT_FOREVER) == AOS_SUCCESS)
+ {
+ // if(AI_VC_client_websocket_handle!=0 && AI_VC_send_queue_data.data)
+ // {
+
+ // int ret = aic_websocket_send(AI_VC_client_websocket_handle,AI_VC_send_queue_data.data,AI_VC_send_queue_data.len,AI_VC_send_queue_data.AIC_WEBSOCKET_OPCODE,
+ // TRUE,AOS_WAIT_FOREVER);
+ // if(AI_VC_send_queue_data.AIC_WEBSOCKET_OPCODE ==AIC_WEBSOCKET_OPCODE_TEXT_FRAME )
+ // bk_printf("VCVC:send text ret=%d,len=%d,str=%s",ret,AI_VC_send_queue_data.len,AI_VC_send_queue_data.data);
+ // else if(AI_VC_send_queue_data.AIC_WEBSOCKET_OPCODE ==AIC_WEBSOCKET_OPCODE_BINARY_FRAME )
+ // bk_printf("VCVC:send bin ret=%d,len=%d",ret,AI_VC_send_queue_data.len);
+ // aic_free(AI_VC_send_queue_data.data);
+
+ // }else
+ // {
+ // bk_printf("AI_VC_send ERROR:AI_VC_client_websocket_handle = %d",AI_VC_client_websocket_handle);
+ // }
+ //bk_printf("AI_VC_send_task:send data len:%d",AI_VC_send_queue_data.len);
+ if(AI_client_VC && AI_VC_send_queue_data.data)
+ {
+ int ret = send_websocket_message(AI_client_VC,AI_VC_send_queue_data.data,AI_VC_send_queue_data.len,
+ (WebSocketMessageType)AI_VC_send_queue_data.AIC_WEBSOCKET_OPCODE);
+ if(AI_VC_send_queue_data.AIC_WEBSOCKET_OPCODE ==AIC_WEBSOCKET_OPCODE_TEXT_FRAME )
+ bk_printf("VCVC:send text ret=%d,len=%d,str=%s",ret,AI_VC_send_queue_data.len,AI_VC_send_queue_data.data);
+ else if(AI_VC_send_queue_data.AIC_WEBSOCKET_OPCODE ==AIC_WEBSOCKET_OPCODE_BINARY_FRAME )
+ bk_printf("VCVC:send bin ret=%d,len=%d",ret,AI_VC_send_queue_data.len);
+ aic_free(AI_VC_send_queue_data.data);
+ }else
+ {
+ bk_printf("AI_VC_send ERROR:close_websocket_client = %d",AI_client_VC);
+ }
+ }else
+ {
+ aos_sleep(1);
+ }
+ }
+
+}
+static u8 recv_buff[10*1024];
+static void AI_VC_read_task(void *thread_input)//websocket 读线程
+{
+ int result_val=0;
+ int status;
+
+ UINT code;
+ bk_printf("AI_VC_read_task go......");
+ while (1) {
+ //if(AI_VC_client_websocket_handle!=0)
+ if(AI_client_VC)
+ {
+ memset(recv_buff,0,sizeof(recv_buff));
+ // status = aic_websocket_recv(AI_VC_client_websocket_handle, recv_buff, sizeof(recv_buff),
+ // &code, AOS_WAIT_FOREVER,&result_val);
+ status = receive_websocket_message(AI_client_VC,recv_buff,sizeof(recv_buff),(WebSocketMessageType *)&code);
+ if(status>0)
+ {
+ close_timerout = 60;
+ if(code == 1)//字符串
+ {
+ bk_printf("VCVC:read TEXT:status:%d,code:%d,result_val:%d,data:%s\n",status,code,result_val,recv_buff);
+ if(strstr(recv_buff,"\"started\""))//开始
+ {
+ VC_state = VC_State_Listening;
+ if(AI_TTS_str)
+ {
+ AI_client_VC_synthesis(AI_TTS_str);
+ aic_free(AI_TTS_str);
+ AI_TTS_str = NULL;
+ VC_state = VC_State_TTSStart;
+ }
+ }else if(strstr(recv_buff,"\"tts.started\""))//tts开始
+ {
+ VC_state = VC_State_TTSStart;
+ AI_AMP_MSG_put(0,0,VC_PLAY_START);//打开声音
+
+ }else if(strstr(recv_buff,"\"completed\""))//结束
+ {
+ VC_state = VC_State_Listening;
+
+ AI_AMP_MSG_put(0,0,VC_RECORD_START);//打开录音
+ }
+ }
+ else if(code == 2)//二进制
+ {
+ bk_printf("VCVC:read BIN status:%d,code:%d\n",status,code);
+ // if(status<1000)
+ // {
+ // bk_printf("VCVC:read :status:%d,code:%d,result_val:%d,data:%s\n",status,code,result_val,recv_buff);
+ // }
+ AI_VC_put_play_data(recv_buff,status);
+ play_data_len+=status;
+
+ }
+ }else if(status <0)//报错,关闭连接
+ {
+
+ AI_AMP_MSG_put(0,0,VC_CONNECT_ERROR);
+ }
+ }else
+ {
+ bk_printf("AI_VC_read_task:error AI_VC_client_websocket_handle=%d\n",AI_VC_client_websocket_handle);
+ aos_sleep(100);
+ }
+ // bk_printf("AI_VC_read_task ..... \n");
+ // aos_sleep(5000);
+
+
+
+ }
+}
+
+static void AI_VC_put_play_data(char *data,u32 len)
+{
+
+ AI_VC_audio_queue_t AI_VC_play_queue_data;
+ AI_VC_play_queue_data.data = aic_malloc(len);
+
+ if(!AI_VC_play_queue_data.data)
+ {
+ bk_printf("AI_VC_put_play_data aic_malloc ERROR!!!!!!!!!!");
+ return;
+ }
+ memcpy(AI_VC_play_queue_data.data,data,len);
+ AI_VC_play_queue_data.len=len;
+ if(AI_VC_play_queue)
+ {
+ if(AOS_SUCCESS != aos_send_to_queue(AI_VC_play_queue,&AI_VC_play_queue_data,AOS_NO_WAIT))
+ goto PUT_PLAY_ERROR;
+ }
+
+ else
+ {
+ bk_printf("AI_VC_put_play_data aos_send_to_queue ERROR!!!!!!!!!!");
+ goto PUT_PLAY_ERROR;
+ }
+
+ return ;
+PUT_PLAY_ERROR:
+ aic_free(AI_VC_play_queue_data.data);
+}
+// char play_tmp_d[66*1024] = {0};
+// u32 play_tmp_d_len = 0;
+
+static void AI_VC_play_task(void *thread_input)//音频播放线程
+{
+ int ret;
+ //bk_stream_play_start();
+ AI_VC_audio_queue_t AI_VC_play_queue_data;
+ bk_printf("AI_VC_play_task go......");
+ while(1)
+ {
+ if(play_data_len >5*1024 && aos_recv_from_queue(AI_VC_play_queue,&AI_VC_play_queue_data,AOS_WAIT_FOREVER) == AOS_SUCCESS)
+ {
+ if(AI_client_VC && AI_VC_play_queue_data.data)
+ {
+ bk_printf("AI_VC_play_task len=%d",AI_VC_play_queue_data.len);
+ // memcpy(play_tmp_d+play_tmp_d_len,AI_VC_play_queue_data.data,AI_VC_play_queue_data.len);
+ // play_tmp_d_len += AI_VC_play_queue_data.len;
+ // if(play_tmp_d_len > 64*1024)
+ // {
+
+ // ret = app_audio_write(APP_AUDIO_TYPE_STREAM_DUPLEX,
+ // play_tmp_d, play_tmp_d_len, AOS_WAIT_FOREVER);
+ // play_tmp_d_len=0;
+ // }
+
+
+
+ int audio_play_time = AI_VC_play_queue_data.len*1000/32000+1;
+ ret = app_audio_write(APP_AUDIO_TYPE_STREAM_DUPLEX,
+ AI_VC_play_queue_data.data, AI_VC_play_queue_data.len, AOS_WAIT_FOREVER);
+ //audio_data(AI_VC_play_queue_data.data,AI_VC_play_queue_data.len,20);
+ if (ret < 0)
+ bk_printf("app_audio_write error, ret=%d,audio_play_time=%d\n", ret,audio_play_time);
+
+ //ret = bk_stream_play_write(AI_VC_play_queue_data.data,AI_VC_play_queue_data.len);
+ bk_printf("VCVC:play ret=%d,len=%d ",ret,AI_VC_play_queue_data.len);
+ aic_free(AI_VC_play_queue_data.data);
+
+ }else
+ {
+ bk_printf("AI_VC_play ERROR:AI_client_VC = %d",AI_client_VC);
+ }
+
+ }else
+ {
+ aos_sleep(1);
+ }
+ }
+ //app_audio_stop(APP_AUDIO_TYPE_STREAM_DUPLEX, NULL);
+}
+
+//打开音频播放
+void VC_Play_Start(void)
+{
+ play_data_len = 0;
+ //创建音频播放线程
+ if(AI_VC_play_task_id == 0)
+ {
+ AI_VC_play_task_id = aos_create_thread(
+ "AI_VC_play",
+ AI_VC_play_task,
+ &AI_VC_play_task_id,
+ 4096u,
+ 0,
+ NULL,
+ ai_VC_task_priority,
+ AOS_AUTO_START);
+ }
+ //创建音频播放队列
+ if(AI_VC_play_queue == NULL)
+ {
+ AI_VC_play_queue = aos_create_queue("AI_VC_play_queue",
+ sizeof(AI_VC_audio_queue_t),
+ 200);
+ }
+
+}
+//关闭音频播放
+void VC_Play_End(void)
+{
+ bk_printf("VC_Play_End!!!!!!!!!!!!");
+ //销毁发送线程
+ if(AI_VC_play_task_id != 0)
+ {
+ aos_delete_thread(AI_VC_play_task_id);
+ AI_VC_play_task_id = 0;
+ }
+ //销毁发送队列
+ if(AI_VC_play_queue != NULL)
+ {
+ char count_t= 200;
+ AI_VC_audio_queue_t AI_VC_play_queue_data_t;
+ while(count_t--)//清空队列数据
+ {
+ if(aos_recv_from_queue(AI_VC_play_queue,&AI_VC_play_queue_data_t,AOS_NO_WAIT) == AOS_SUCCESS)
+ {
+ if(AI_VC_play_queue_data_t.data)
+ aic_free(AI_VC_play_queue_data_t.data);
+ }
+ else{
+ break;
+ }
+ }
+ aos_delete_queue(AI_VC_play_queue);
+ AI_VC_play_queue = NULL;
+ }
+ //app_audio_stop(APP_AUDIO_TYPE_STREAM_DUPLEX, NULL);
+}
+
+static void AI_VC_put_record_data(char *data,u32 len)
+{
+
+ AI_VC_audio_queue_t AI_VC_record_queue_data;
+ AI_VC_record_queue_data.data = aic_malloc(len);
+
+ if(!AI_VC_record_queue_data.data)
+ {
+ bk_printf("AI_VC_put_record_data aic_malloc ERROR!!!!!!!!!!");
+ return;
+ }
+ memcpy(AI_VC_record_queue_data.data,data,len);
+ AI_VC_record_queue_data.len=len;
+ if(AI_VC_record_tmp_queue)
+ {
+ if(AOS_SUCCESS != aos_send_to_queue(AI_VC_record_tmp_queue,&AI_VC_record_queue_data,AOS_NO_WAIT))
+ {
+ goto PUT_RECORD_ERROR;
+ }
+ }
+ else
+ {
+ bk_printf("AI_VC_put_record_data aos_send_to_queue ERROR!!!!!!!!!!");
+ goto PUT_RECORD_ERROR;
+ }
+
+ return;
+PUT_RECORD_ERROR:
+ aic_free(AI_VC_record_queue_data.data);
+
+}
+u8 vrecord_buf[3500 + 4];
+static void AI_VC_record_task(void *thread_input)//录音线程
+{
+
+ //bk_stream_record_start();
+ int ret = 0;
+ bk_printf("AI_VC_record_task go......");
+ AI_VC_audio_queue_t AI_VC_play_record_data;
+ while(1)
+ {
+ ret = app_audio_read(APP_AUDIO_TYPE_STREAM_DUPLEX,
+ vrecord_buf, 3200, 100);
+ if(VC_state == VC_State_None)//开启的时候,先缓存音频
+ {
+
+ AI_VC_put_record_data(vrecord_buf,ret);
+ }else if(VC_state >= VC_State_Listening && VC_state<VC_State_TTSStart)//正常录音
+ {
+ char count_t = 200;
+ while(count_t--)
+ {
+ if(aos_recv_from_queue(AI_VC_record_tmp_queue,&AI_VC_play_record_data,AOS_NO_WAIT) == AOS_SUCCESS)//有录音数据
+ {
+ AI_VC_send_data(AI_VC_play_record_data.data,AI_VC_play_record_data.len,AIC_WEBSOCKET_OPCODE_BINARY_FRAME);
+ aic_free(AI_VC_play_record_data.data);
+ }else
+ break;
+ }
+ AI_VC_send_data(vrecord_buf,ret,AIC_WEBSOCKET_OPCODE_BINARY_FRAME);
+ bk_printf("AI_VC_record_task send_data len = %d",ret);
+ }else
+ {
+ char count_t = 200;
+ while(count_t--)//清掉缓存
+ {
+ if(aos_recv_from_queue(AI_VC_record_tmp_queue,&AI_VC_play_record_data,AOS_NO_WAIT) == AOS_SUCCESS)//有录音数据
+ {
+ aic_free(AI_VC_play_record_data.data);
+ }else
+ break;
+ }
+ }
+ aos_sleep(40);
+ }
+ //app_audio_stop(APP_AUDIO_TYPE_STREAM_DUPLEX, NULL);
+}
+
+//打开录音
+void VC_record_Start(void)
+{
+
+ //创建录音线程
+ if(AI_VC_record_task_id == 0)
+ {
+ AI_VC_record_task_id = aos_create_thread(
+ "AI_VC_record",
+ AI_VC_record_task,
+ &AI_VC_record_task_id,
+ 4096u,
+ 0,
+ NULL,
+ ai_VC_task_priority,
+ AOS_AUTO_START);
+ }
+ //创建录音队列
+ if(AI_VC_record_tmp_queue == NULL)
+ {
+ AI_VC_record_tmp_queue = aos_create_queue("AI_VC_record_tmp_queue",
+ sizeof(AI_VC_audio_queue_t),
+ 200);
+ }
+}
+//关闭录音
+void VC_record_End(void)
+{
+ bk_printf("VC_record_End!!!!!!!!!!!!");
+ //销毁发送线程
+ if(AI_VC_record_task_id != 0)
+ {
+ aos_delete_thread(AI_VC_record_task_id);
+ AI_VC_record_task_id = 0;
+ }
+ //销毁录音缓存队列
+ if(AI_VC_record_tmp_queue != NULL)
+ {
+ char count_t= 200;
+ AI_VC_audio_queue_t AI_VC_record_tmp_queue_data_t;
+ while(count_t--)//清空队列数据
+ {
+ if(aos_recv_from_queue(AI_VC_record_tmp_queue,&AI_VC_record_tmp_queue_data_t,AOS_NO_WAIT) == AOS_SUCCESS)
+ {
+ if(AI_VC_record_tmp_queue_data_t.data)
+ aic_free(AI_VC_record_tmp_queue_data_t.data);
+ }
+ else{
+ break;
+ }
+ }
+ aos_delete_queue(AI_VC_record_tmp_queue);
+ AI_VC_record_tmp_queue = NULL;
+ }
+
+
+}
+static void AI_VC_1S_timeout(void *param)
+{
+ if(close_timerout>0)
+ {
+ close_timerout--;
+ if(close_timerout<=0)
+ {
+ AI_AMP_MSG_put(0,0,VC_CLOSE);
+ }
+ }
+}
+void AI_VC_start(void)
+{
+ int ret = 0;
+ VC_state = VC_State_None;
+ app_audio_param_t param;
+ param.channel = 1;
+ param.format = ASTREAM_FORMAT_PCM;
+ param.sample_rate = 16000;
+ param.flag = 0;
+ param.bit_rate = 0;
+ play_data_len = 0;
+ ret = app_audio_start(APP_AUDIO_TYPE_STREAM_DUPLEX, ¶m, NULL);//初始化音频
+ app_audio_set_master_volume(2);
+ if (ret) {
+ bk_printf("AI_VC_start app_audio_start error");
+ return;
+ }
+ if(AI_VC_1S_timer == NULL)
+ {
+ AI_VC_1S_timer = aos_create_timer("AI_VC_1S_timer",
+ AI_VC_1S_timeout, NULL,
+ 1000,
+ AOS_AUTO_ACTIVATE, AOS_BE_PERIOD);
+ aic_assert(AI_VC_1S_timer);
+ }
+ VC_record_Start();
+ websocket_connect_VC();
+ aos_sleep(5);
+ AI_VC_send_satrt();
+ close_timerout = 0;
+}
+
+void AI_VC_Close(void)
+{
+ bk_printf("AI_VC_Close!!!!!!!!!!!!");
+ app_audio_stop(APP_AUDIO_TYPE_STREAM_DUPLEX, NULL);
+ VC_record_End();
+ bk_printf("AI_VC_Close1!!!!!!!!!!!!");
+ VC_Play_End();
+ bk_printf("AI_VC_Close2!!!!!!!!!!!!");
+ websocket_deconnect_VC();
+ bk_printf("AI_VC_Close3!!!!!!!!!!!!");
+ if(AI_TTS_str)
+ {
+ aic_free(AI_TTS_str);
+ AI_TTS_str = NULL;
+ }
+ if(AI_VC_1S_timer)
+ {
+ aos_delete_timer(AI_VC_1S_timer);
+ AI_VC_1S_timer = NULL;
+ }
+ close_timerout = 0;
+}
+static aos_status AI_AMP_MSG_put(char *data,u32 len,AI_AMP_MSG_Type MSG_Type)
+{
+ AI_AMP_MSG_queue_t AI_AMP_MSG_queue_data = {0};
+ if(len >0)
+ {
+ AI_AMP_MSG_queue_data.data = aic_malloc(len+1);
+ memset(AI_AMP_MSG_queue_data.data ,0,len+1);
+ if(!AI_AMP_MSG_queue_data.data)
+ {
+ bk_printf("AI_VC_send_data aic_malloc ERROR!!!!!!!!!!");
+ return AOS_ERROR;
+ }
+ memcpy(AI_AMP_MSG_queue_data.data,data,len);
+ AI_AMP_MSG_queue_data.len=len;
+ }
+
+ AI_AMP_MSG_queue_data.MSG_Type=MSG_Type;
+ if(AI_AMP_task_queue && AOS_SUCCESS!=aos_send_to_queue(AI_AMP_task_queue,&AI_AMP_MSG_queue_data,AOS_NO_WAIT))
+ {
+ if(!AI_AMP_MSG_queue_data.data)
+ aic_free(AI_AMP_MSG_queue_data.data);
+ return AOS_ERROR;
+ }
+
+ return AOS_SUCCESS;
+}
+
+static void AI_AMP_2_5_task(void *thread_input)//做逻辑线程
+{
+ char count = 20;
+ boolean pdp_activated ;
+ AI_AMP_MSG_queue_t AI_AMP_msg = {0};
+ while(count --)
+ {
+ pdp_activated = aic_is_default_pdp_activated();
+ if(pdp_activated == TRUE)
+ break;
+ bk_printf("AI_AMP_2_5_init 等待注网..... \n");
+ aos_sleep(1000);
+ }
+ char *tts_str = "你好!我是巴马四季甘泉的智能助手。我可以为你解答各种各样的问题,像是有关巴马四季甘泉知识库、中基长寿科学产品、卫斯曼院士国际先进医疗中心的问题,还有日常生活与工作、旅游信息、健康咨询、教育与学习、情感交流、全球资讯、世界文化等方面的问题哦。你有没有这方面的问题想要问我呀?";
+ VC_TTS_Play(tts_str);
+ while (1) {
+
+ aos_recv_from_queue(AI_AMP_task_queue,&AI_AMP_msg,AOS_WAIT_FOREVER) ;
+ switch (AI_AMP_msg.MSG_Type)
+ {
+ case VC_CLOSE:
+ AI_VC_Close();
+ break;
+ case VC_START:
+ AI_VC_start();
+ break;
+ case VC_PLAY_START:
+ VC_Play_Start();
+ break;
+ case VC_PLAY_END:
+ VC_Play_End();
+ break;
+ case VC_RECORD_START:
+ VC_record_Start();
+ break;
+ case VC_RECORD_END:
+ VC_record_End();
+ break;
+
+
+ case VC_CONNECT_ERROR://连接错误
+ AI_VC_Close();
+
+ break;
+
+ default:
+ break;
+ }
+ if(AI_AMP_msg.data)
+ aic_free(AI_AMP_msg.data);
+ }
+}
+
+int AI_AMP_2_5_init(void)
+{
+ app_logi("AI_AMP_2_5_init HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH. \n");
+ /* Initial app msg queue for extern event handle and dispatch. */
+ // app_msg_init();
+ /**
+ * 1.Com number is aic_uart array index, aic_uart at aicos\projects\xxx\config\serial\serial_config.h;
+ * 2.use aic_uart[index] parameter to set serial.
+ */
+ ai_uart_handle = uart_open(1);
+ aic_assert(ai_uart_handle);
+
+ /* change baudrate */
+ uart_set_baud_rate(ai_uart_handle, 921600);
+ //创建AI_AMP_task队列
+ if(AI_AMP_task_queue == NULL)
+ {
+ AI_AMP_task_queue = aos_create_queue("AI_VC_record_tmp_queue",
+ sizeof(AI_AMP_MSG_queue_t),
+ 200);
+ }
+ AI_AMP_task_id = aos_create_thread(
+ "AI_AMP_2_5",
+ AI_AMP_2_5_task,
+ &AI_AMP_task_id,
+ 4096u,
+ 0,
+ NULL,
+ ai_VC_task_priority,
+ AOS_AUTO_START);
+
+ return AIC_SUCCESS;
+}
+
+AIC_NORMAL_APP_P2_INIT_EXPORT(AI_AMP_2_5_init);
+
+
\ No newline at end of file
--- /dev/null
+# General configuration options
+#
+# Copyright 2023 by AICXTEK TECHNOLOGIES CO.,LTD. All rights reserved.
+
+aic_library_sources_ifdef(
+ CONFIG_APP_AI_AMP_2_5
+ ${AIC_SOURCE_ROOT}/app/AI_AMP_2_5/AI_AMP_2_5.c
+ ${AIC_SOURCE_ROOT}/app/AI_AMP_2_5/helios_ringbuf.c
+ ${AIC_SOURCE_ROOT}/app/AI_AMP_2_5/stream_play.c
+ ${AIC_SOURCE_ROOT}/app/AI_AMP_2_5/bk_websocket.c
+)
+
+aic_library_include_directories_ifdef(
+ CONFIG_APP_AI_AMP_2_5
+ ${AIC_SOURCE_ROOT}/app/AI_AMP_2_5/
+)
\ No newline at end of file
--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <strings.h>
+
+#include <nx_api.h>
+#include <nx_ip.h>
+#include <nx_ipv6.h>
+#include <nx_tcp.h>
+#include <nx_packet.h>
+#include <nxd_bsd.h>
+#include <nx_websocket_client.h>
+
+#include <aic_init.h>
+#include <aic_osa.h>
+#include <aic_errno.h>
+#include <aic_net_api.h>
+#include <aic_net_pdp_mgr.h>
+#include <aic_websocket_client.h>
+extern int bk_printf(const char *format, ...);
+extern void bk_print_hex(u8 *data,int data_len);
+#ifdef CONFIG_CRYPTO_MBEDTLS
+#ifdef CONFIG_CRYPTO_MBEDTLS_2
+#include "mbedtls/net.h"
+#else
+#include "mbedtls/net_sockets.h"
+#endif
+#include <mbedtls/ssl.h>
+#include <mbedtls/entropy.h>
+#include <mbedtls/ctr_drbg.h>
+#include <mbedtls/error.h>
+#include <mbedtls/x509_crt.h>
+
+// typedef struct aic_websocket_mbedtls_session {
+// mbedtls_ssl_context ssl;
+// mbedtls_entropy_context entropy;
+// mbedtls_ctr_drbg_context ctr_drbg;
+// mbedtls_ssl_config conf;
+// mbedtls_net_context socket_fd;
+// CHAR status;
+// ULONG recv_wait_time;
+// } WEBSOCKET_MBEDTLS_SESSION;
+#endif
+
+#include "mbedtls/base64.h"
+#include "mbedtls/sha1.h"
+
+
+#define BUFFER_SIZE 4096
+#define WEBSOCKET_KEY_LEN 24
+#define WEBSOCKET_GUID "1234567890123456"
+
+
+
+#include "bk_websocket.h"
+
+#include <stdint.h>
+#include <stdint.h>
+void bk_sleep(u32 time)
+{
+ aos_sleep(time);
+}
+// 仿写 htonl 函数
+static uint32_t htonl(uint32_t hostlong) {
+ // 检查主机是否为大端字节序
+ static const union {
+ uint32_t i;
+ char c[4];
+ } test = {0x01000000};
+ if (test.c[0] == 0x01) {
+ // 主机是大端字节序,不需要转换
+ return hostlong;
+ }
+
+ // 主机是小端字节序,进行字节序转换
+ return ((hostlong & 0x000000FF) << 24) |
+ ((hostlong & 0x0000FF00) << 8) |
+ ((hostlong & 0x00FF0000) >> 8) |
+ ((hostlong & 0xFF000000) >> 24);
+}
+// 仿写 htonll 函数
+static uint64_t htonll(uint64_t hostlonglong) {
+ // 检查主机是否为大端字节序
+ static const union {
+ uint32_t i;
+ char c[4];
+ } test = {0x01000000};
+ if (test.c[0] == 0x01) {
+ // 主机是大端字节序,不需要转换
+ return hostlonglong;
+ }
+
+ // 将 64 位整数拆分为两个 32 位整数
+ uint32_t high = (hostlonglong >> 32) & 0xFFFFFFFF;
+ uint32_t low = hostlonglong & 0xFFFFFFFF;
+
+ // 分别转换两个 32 位整数的字节序
+ high = htonl(high);
+ low = htonl(low);
+
+ // 合并转换后的两个 32 位整数
+ return ((uint64_t)low << 32) | high;
+}
+// 仿写 ntohll 函数
+static uint64_t ntohll(uint64_t netlonglong) {
+ // 将 64 位整数拆分为两个 32 位整数
+ uint32_t high = (netlonglong >> 32) & 0xFFFFFFFF;
+ uint32_t low = netlonglong & 0xFFFFFFFF;
+
+ // 分别转换两个 32 位整数的字节序
+ high = ntohl(high);
+ low = ntohl(low);
+
+ // 合并转换后的两个 32 位整数
+ return ((uint64_t)high << 32) | low;
+}
+// 生成随机的 WebSocket 密钥
+void generate_websocket_key(char *key) {
+ static const char charset[] =
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+ for (int i = 0; i < WEBSOCKET_KEY_LEN - 1; ++i) {
+ key[i] = charset[rand() % (sizeof(charset) - 1)];
+ }
+ key[WEBSOCKET_KEY_LEN - 1] = '\0';
+
+ unsigned char encoded[WEBSOCKET_KEY_LEN * 2];
+ size_t olen;
+ mbedtls_base64_encode(encoded, sizeof(encoded), &olen, (const unsigned char *)key, strlen(key));
+ strncpy(key, (const char *)encoded, olen);
+ key[olen] = '\0';
+}
+
+// 生成 WebSocket 握手响应密钥
+void generate_accept_key(const char *key, char *accept_key) {
+ char combined[128];
+ strcpy(combined, key);
+ strcat(combined, WEBSOCKET_GUID);
+
+ unsigned char sha1_result[20];
+ mbedtls_sha1((const unsigned char *)combined, strlen(combined), sha1_result);
+
+ unsigned char encoded[64];
+ size_t olen;
+ mbedtls_base64_encode(encoded, sizeof(encoded), &olen, sha1_result, 16);//sizeof(sha1_result));
+ strncpy(accept_key, (const char *)encoded, olen);
+ accept_key[olen] = '\0';
+}
+
+// 发送 WebSocket 握手请求
+int send_handshake(WebSocketClient *client) {
+ char key[WEBSOCKET_KEY_LEN];
+ bk_printf("send_handshake1");
+ generate_websocket_key(key);
+ char accept_key[64];
+ int ret = 0;
+ generate_accept_key(key, accept_key);
+ bk_printf("send_handshake2");
+ char *request =aic_zalloc(BUFFER_SIZE);
+ snprintf(request, BUFFER_SIZE,
+ "GET %s HTTP/1.1\r\n"
+ "Host: %s:%d\r\n"
+ "Upgrade: websocket\r\n"
+ "Connection: Upgrade\r\n"
+ "Sec-WebSocket-Key: %s\r\n"
+ "Sec-WebSocket-Version: 13\r\n"
+ "Origin: http://%s:%d\r\n"
+ "\r\n",
+ client->path, client->host,client->port, accept_key,client->host,client->port);
+ bk_printf("send_handshake request:\r\n%s",request);
+ if (send(client->sockfd, request, strlen(request), 0) < 0) {
+ bk_printf("send handshake failed");
+
+ ret = -1;
+ }
+ bk_printf("send_handshake3");
+ aic_free(request);
+ return ret;
+}
+
+
+// 发送 WebSocket 消息
+int send_websocket_message(WebSocketClient *client, const unsigned char *message, size_t message_len, WebSocketMessageType type) {
+ unsigned char *frame=aic_zalloc(message_len + 50);
+ int offset = 0;
+ int ret = -1;
+ if(!frame)
+ {
+ bk_printf("send_websocket_message zalloc error");
+ return -1;
+ }
+ // 第一个字节:FIN = 1, 设置 opcode
+ frame[offset++] = 0x80 | type;
+
+ // 第二个字节:设置掩码位和负载长度
+ if (message_len < 126) {
+ frame[offset++] = 0x80 | message_len;
+ } else if (message_len < 65536) {
+ frame[offset++] = 0x80 | 126;
+ uint16_t len = htons((uint16_t)message_len);
+ memcpy(frame + offset, &len, 2);
+ offset += 2;
+ } else {
+ frame[offset++] = 0x80 | 127;
+ uint64_t len = htonll(message_len);
+ memcpy(frame + offset, &len, 8);
+ offset += 8;
+ }
+
+ // 生成掩码密钥
+ unsigned char masking_key[4];
+ for (int i = 0; i < 4; ++i) {
+ masking_key[i] = (unsigned char)rand();
+ }
+ memcpy(frame + offset, masking_key, 4);
+ offset += 4;
+
+ // 掩码处理消息
+ for (size_t i = 0; i < message_len; ++i) {
+ frame[offset + i] = message[i] ^ masking_key[i % 4];
+ }
+ offset += message_len;
+
+ // 发送帧
+ if (send(client->sockfd, frame, offset, 0) < 0) {
+ bk_printf("send message failed");
+ ret = -1;
+ goto send_websocket_message_ERROR;
+ }
+ ret = 0;
+send_websocket_message_ERROR:
+ aic_free(frame);
+ return ret;
+}
+
+// 接收 WebSocket 消息,返回读到长度
+int receive_websocket_message(WebSocketClient *client, unsigned char *buf,int len,WebSocketMessageType *code) {
+
+ unsigned char frame[20]={0};
+ unsigned char masking_key[4];
+ unsigned int bytes_received = 0;
+ int recv_len = 0 ;
+ while(1)
+ {
+ recv_len = recv(client->sockfd, frame+bytes_received, 2-bytes_received, 0);
+ bytes_received +=recv_len;
+ if(bytes_received>=2)
+ break;
+ }
+
+ if (bytes_received <= 0) {
+ if (bytes_received == 0) {
+ printf("Connection closed by server.\n");
+ } else {
+ bk_printf("receive message failed");
+ }
+ return -1;
+ }
+ //unsigned char fin = (frame[0] & 0x80) >> 7;
+ *code = frame[0] & 0x0F;
+ unsigned char mask = (frame[1] & 0x80) >> 7;
+ unsigned int payload_len = frame[1] & 0x7F;
+ if(frame[0]!= 0x80 && frame[0]!= 0x81 && frame[0]!= 0x82 && frame[0]!= 0x88 && frame[0]!= 0x89 && frame[0]!= 0x8A)
+ {
+ bk_printf("receive_websocket_message:hend =0x%X,0x%X ERROR:",frame[0],frame[1]);
+ bytes_received = recv(client->sockfd, buf, len, 0);
+ if(bytes_received>0)
+ bk_print_hex(buf,bytes_received);
+ return -1;
+ }
+
+ size_t offset = 2;
+ if (payload_len == 126) {
+ unsigned short extended_payload_len;
+ bytes_received += recv(client->sockfd, frame+offset, 2, 0);
+ memcpy(&extended_payload_len, frame + 2, 2);
+ payload_len = ntohs(extended_payload_len);
+ //bk_printf("receive_websocket_message:payload_len=0x%X",extended_payload_len);
+ offset += 2;
+ } else if (payload_len == 127) {
+ u64 extended_payload_len;
+ bytes_received += recv(client->sockfd, frame+offset, 8, 0);
+ memcpy(&extended_payload_len, frame + 2, 8);
+ payload_len = ntohll(extended_payload_len);
+ offset += 8;
+ }
+ if(payload_len>len)
+ {
+ bk_printf("receive_websocket_message:len ERROR");
+ recv(client->sockfd, buf, len, 0);
+ return -1;
+ }
+ bk_printf("receive_websocket_message :");
+ for(int i = 0;i<offset;i++)
+ {
+ bk_printf("%02X",frame[i]);
+ }
+ // bk_printf("receive_websocket_message:payload_len=%d frame[0]&0x8E=%d",payload_len,frame[0]&0x8E);
+ if (mask) {
+
+ bytes_received = recv(client->sockfd, frame+offset, 4, 0);
+ memcpy(masking_key, frame + offset, 4);
+ offset += 4;
+ }
+ bytes_received = 0;
+ while(1)
+ {
+ recv_len = recv(client->sockfd, buf+bytes_received, payload_len-bytes_received, 0);
+ if(recv_len>0)
+ bytes_received += recv_len;
+ else if(recv_len<0)
+ {
+ bk_printf("receive_websocket_message: recv_len =%d recv ERROR!!!!!!",recv_len);
+ return -1;
+ }
+ bk_printf("receive_websocket_message:bytes_received=%d recv_len =%d",bytes_received,recv_len);
+ if(bytes_received >= payload_len)
+ {
+ bk_printf("receive_websocket_message:payload_len=%d,bytes_received=%d",payload_len,bytes_received);
+ break;
+ }
+ bk_sleep(1);
+ }
+ if(mask)
+ {
+ for (size_t i = 0; i < payload_len; ++i) {
+ buf[i] = buf[i] ^ masking_key[i % 4];
+ }
+ }
+
+ // if (*code == WS_TEXT) {
+ // printf("Received text message: %.*s\n", (int)payload_len, buf);
+ // } else if (*code == WS_BINARY) {
+ // printf("Received binary message of length %zu\n", payload_len);
+ // }
+
+ if (*code == WS_TEXT)
+ {
+
+ }else if(*code == WS_BINARY)
+ {
+
+ }else if(*code == WS_CLOSE)
+ {
+ payload_len = 0;
+ }else if(*code == WS_PONG)
+ {
+ payload_len = 0;
+ }else if(*code == WS_PING)
+ {
+ send_websocket_message(client,buf,payload_len,WS_PONG);
+ payload_len = 0;
+ }else if(*code == WS_CONT)
+ {
+ payload_len = 0;
+ }
+ return payload_len;//parse_frame(buf, bytes_received, buf,code);
+}
+
+// 初始化 WebSocket 客户端
+WebSocketClient *init_websocket_client(const char *host, const char *path, int port) {
+ //bk_printf("init_websocket_client 1\n");
+ char *buffer = NULL;
+ WebSocketClient *client = aic_zalloc(sizeof(WebSocketClient)) ;
+ if(!client)
+ {
+ bk_printf("init_websocket_client alloc error");
+ return NULL;
+ }
+ client->sockfd = socket(AF_INET, SOCK_STREAM, 0);
+ if (client->sockfd < 0) {
+ bk_printf("socket creation failed");
+ goto client_ERROR;
+ }
+
+ // bk_printf("init_websocket_client 3\n");
+ struct sockaddr_in server_addr;
+ server_addr.sin_family = AF_INET;
+ server_addr.sin_port = htons(port);
+ inet_pton(AF_INET, host, &server_addr.sin_addr);
+
+ if (connect(client->sockfd, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) {
+ bk_printf("connection failed");
+ close(client->sockfd);
+ goto client_ERROR;
+ }
+
+
+ strcpy(client->host, host);
+ strcpy(client->path, path);
+ client->port = port;
+ if (send_handshake(client) < 0) {
+ close(client->sockfd);
+ goto client_ERROR;
+ }
+
+ buffer=aic_zalloc(BUFFER_SIZE);
+ ssize_t bytes_received = recv(client->sockfd, buffer, BUFFER_SIZE - 1, 0);
+ if (bytes_received > 0) {
+ buffer[bytes_received] = '\0';
+ bk_printf("Received handshake response:\n%s\n", buffer);
+ }
+ if(strstr(buffer,"HTTP/1.1 101") == NULL)
+ {
+
+ goto client_ERROR;
+ }
+ aic_free(buffer);
+
+ return client;
+client_ERROR:
+ if(buffer)
+ aic_free(buffer);
+ if(client)
+ aic_free(client);
+ return NULL;
+}
+
+// 关闭 WebSocket 客户端
+void close_websocket_client(WebSocketClient *client) {
+ if(client)
+ {
+ soc_close(client->sockfd);
+ aic_free(client);
+ }
+
+}
+
+int bk_websocket_demo(void) {
+ WebSocketClient *client;
+ client = init_websocket_client("127.0.0.1", "/", 8080) ;
+ if (client== NULL) {
+ return -1;
+ }
+
+
+
+ close_websocket_client(client);
+ return 0;
+}
+
\ No newline at end of file
--- /dev/null
+
+#ifndef __BK_WEBSOCKET_H__
+#define __BK_WEBSOCKET_H__
+#include "aic_osa.h"
+// WebSocket 消息类型枚举
+typedef enum {
+ WS_CONT = 0x00,
+ WS_TEXT = 0x01,
+ WS_BINARY = 0x02,
+ WS_CLOSE = 0x8,
+ WS_PING = 0x9,
+ WS_PONG = 0xa
+} WebSocketMessageType;
+// WebSocket 客户端结构体
+typedef struct {
+ int sockfd;
+ char host[128];
+ char path[128];
+ int port;
+} WebSocketClient;
+
+
+// 初始化 WebSocket 客户端
+WebSocketClient *init_websocket_client(const char *host, const char *path, int port);
+
+// 关闭 WebSocket 客户端
+void close_websocket_client(WebSocketClient *client) ;
+
+// 接收 WebSocket 消息
+int receive_websocket_message(WebSocketClient *client, unsigned char *buf,int len,WebSocketMessageType *code);
+
+// 发送 WebSocket 消息
+int send_websocket_message(WebSocketClient *client, const unsigned char *message, size_t message_len, WebSocketMessageType type) ;
+
+#endif
--- /dev/null
+/*
+ * Copyright (c) Quectel Wireless Solution, Co., Ltd.All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include "stdlib.h"
+#include "string.h"
+#define AIC_THIS_FILE 0x888889
+#include "helios_ringbuf.h"
+#include "aic_assert_def.h"
+helios_ring_buf_t *helios_rb_create(unsigned int size)
+{
+ helios_ring_buf_t *rb = NULL;
+
+ if (size <= 0) {
+ return NULL;
+ }
+
+ AIC_ASSERT(!(size&(size - 1))); // 此ringbuffer长度必须为2的n次方
+
+ rb = malloc(sizeof(helios_ring_buf_t));
+ if (NULL == rb) {
+ return NULL;
+ }
+ memset(rb, 0, sizeof(helios_ring_buf_t));
+
+ rb->data = malloc(size);
+ memset(rb->data, 0, size);
+ if (NULL == rb->data) {
+ free(rb);
+ return NULL;
+ }
+
+ rb->size = size;
+
+ return rb;
+}
+
+void helios_rb_destroy(helios_ring_buf_t **rb)
+{
+ if (*rb) {
+ if ((*rb)->data) {
+ free((*rb)->data);
+ (*rb)->data = NULL;
+ }
+ free(*rb);
+ *rb = NULL;
+ }
+}
+
+unsigned int helios_rb_is_empty(helios_ring_buf_t *rb)
+{
+ return (rb->wpos == rb->rpos);
+}
+
+unsigned int helios_rb_is_full(helios_ring_buf_t *rb)
+{
+ return (rb->size == (unsigned int)(rb->wpos-rb->rpos));
+}
+
+unsigned int helios_rb_data_len(helios_ring_buf_t *rb)
+{
+ return (rb->wpos - rb->rpos);
+}
+
+unsigned int helios_rb_free_space(helios_ring_buf_t *rb)
+{
+ return (rb->size - (rb->wpos - rb->rpos));
+}
+
+void helios_rb_clear(helios_ring_buf_t *rb)
+{
+ rb->wpos = rb->rpos = 0;
+ memset(rb->data, 0, rb->size);
+ return;
+}
+
+unsigned int helios_rb_write(helios_ring_buf_t *rb, unsigned char *data, unsigned int len)
+{
+ unsigned int w_size = 0, w_free_size = 0;
+ unsigned int r_free_size = 0;
+
+ if (!rb || !data || (len <= 0)) {
+ //quec_log("%s,rb=%#x,data=%#x,len=%d",__func__,rb,data,len);
+ return 0;
+ }
+ //shaohua.li@20200922
+ //��ֹ���̲߳������»�ȡ��r_free_size��
+ //��Ŀ�����ǰ�����ε���helios_rb_free_space(rb)����ֵ��һ�£�(��һ�ε��ú������̴߳�ϣ������̴߳�rb�������ݵ��µڶ��η���ֵ��ȡ��??
+ //����w_size��ֵС��lenֵ������ʹ���潫dataָ���������copy��rb
+ //w_size = len < helios_rb_free_space(rb) ? len : helios_rb_free_space(rb);
+ r_free_size = helios_rb_free_space(rb);
+ w_size = len < r_free_size ? len : r_free_size;
+
+ /* first put the data starting from write_pos to buffer end */
+ w_free_size = w_size < (rb->size-(rb->wpos&(rb->size-1))) ? w_size : (rb->size-(rb->wpos&(rb->size-1)));
+
+ memcpy(rb->data+(rb->wpos&(rb->size-1)), data, w_free_size);
+ /* then put the rest (if any) at the beginning of the buffer */
+ memcpy(rb->data, data+w_free_size, w_size-w_free_size);
+
+ rb->wpos += w_size;
+
+ return w_size;
+}
+
+unsigned int helios_rb_read(helios_ring_buf_t *rb, unsigned char *data, unsigned int len)
+{
+ unsigned int r_size = 0, r_free_size = 0;
+ unsigned int r_data_len = 0;
+
+ if (!rb || !data || (len <= 0)) {
+ //quec_log("%s,rb=%#x,data=%#x,len=%d",__func__,rb,data,len);
+ return 0;
+ }
+
+ //shaohua.li@20200922
+ //��ֹ���̲߳������»�ȡ��datalen��
+ //��Ŀ�����ǰ�����ε���helios_rb_data_len(rb)����ֵ��һ�£�(��һ�ε��ú������̴߳�ϣ�������rbд�����ݵ��µڶ��λ�ȡ��??
+ //����r_size��ֵ����lenֵ������ʹ�������dataָ��Խ��
+ //r_size = len < helios_rb_data_len(rb) ? len : helios_rb_data_len(rb);
+ r_data_len = helios_rb_data_len(rb);
+ r_size = len < r_data_len ? len : r_data_len;
+
+ /* first get the data from ring_buf->read_pos until the end of the buffer */
+ r_free_size = r_size < (rb->size-(rb->rpos&(rb->size-1))) ? r_size : (rb->size-(rb->rpos&(rb->size-1)));
+
+ memcpy(data, rb->data+(rb->rpos&(rb->size-1)), r_free_size);
+ /* then get the rest (if any) from the beginning of the buffer */
+ memcpy(data+r_free_size, rb->data, r_size-r_free_size);
+
+ rb->rpos += r_size;
+
+ return r_size;
+}
+
+
--- /dev/null
+/*
+ * Copyright (c) Quectel Wireless Solution, Co., Ltd.All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __HELIOS_RINGBUF_H__
+#define __HELIOS_RINGBUF_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+typedef unsigned long long u64;
+
+typedef struct helios_ring_buf_struct {
+ unsigned int size;
+ u64 rpos;
+ u64 wpos;
+ unsigned char *data;
+}helios_ring_buf_t;
+
+
+
+helios_ring_buf_t *helios_rb_create(unsigned int size);
+
+void helios_rb_destroy(helios_ring_buf_t **rb);
+
+unsigned int helios_rb_is_empty(helios_ring_buf_t *rb);
+
+unsigned int helios_rb_is_full(helios_ring_buf_t *rb);
+
+unsigned int helios_rb_data_len(helios_ring_buf_t *rb);
+
+unsigned int helios_rb_free_space(helios_ring_buf_t *rb);
+
+unsigned int helios_rb_write(helios_ring_buf_t *rb, unsigned char *data, unsigned int len);
+
+unsigned int helios_rb_read(helios_ring_buf_t *rb, unsigned char *data, unsigned int len);
+
+void helios_rb_clear(helios_ring_buf_t *rb);
+
+#ifdef __cplusplus
+} /*"C" */
+#endif
+
+
+#endif
--- /dev/null
+#define AIC_THIS_FILE 0x88888a
+#include <stdio.h>
+#include "stdlib.h"
+#include "string.h"
+#include "helios_ringbuf.h"
+#include "aic_osa.h"
+#include "app_audio.h"
+#include "stream_play.h"
+extern int bk_printf(const char *format, ...);
+int bk_stream_play_handle = 0;
+static aos_thread_id bk_stream_play_task_id = 0;
+static helios_ring_buf_t *bk_stream_play_rb;
+#define PCM_READ_BUF_LEN 4*1024
+char p_data[PCM_READ_BUF_LEN]={0};
+#define ring_buf_len 32*1024
+static void bk_stream_play_task(void *thread_input)//音频播放线程
+{
+ while(1)
+ {
+ int bytes_read = helios_rb_read(bk_stream_play_rb, (unsigned char*)p_data, PCM_READ_BUF_LEN);
+ if(bytes_read>0)
+ {
+ if(bk_stream_play_handle)
+ {
+ int data_sum = audio_write(bk_stream_play_handle, p_data, bytes_read, AOS_WAIT_FOREVER);
+ if(data_sum<1)
+ {
+ //printf("helios_audio_PCM_stream_task:pcm write error\r\n");
+ bk_printf("bk_stream_play_task audio_write error!!!!!!!");
+ }
+ }
+
+ }
+ }
+}
+int bk_stream_play_start(void)
+{
+ bk_stream_play_rb = helios_rb_create(ring_buf_len);
+ if(bk_stream_play_handle == 0)
+ {
+ bk_stream_play_handle = audio_open(ASTREAM_TYPE_MUSIC,
+ APLAY_TYPE_STREAM,
+ 0,
+ 16000,
+ 16,
+ ASTREAM_FORMAT_PCM,
+ ASTREAM_CHN_MONO,
+ ASTREAM_DIR_PLAY,
+ ASTREAM_SOURCE_DEFAULT);
+ }
+ if(bk_stream_play_handle)
+ audio_play_stream(bk_stream_play_handle, NULL, 0);
+ if(bk_stream_play_task_id == 0)
+ {
+ bk_stream_play_task_id = aos_create_thread(
+ "AI_VC_play",
+ bk_stream_play_task,
+ &bk_stream_play_task_id,
+ 4096u,
+ 0,
+ NULL,
+ 35,
+ AOS_AUTO_START);
+ }
+
+}
+int bk_stream_play_write(char *data ,u32 len)
+{
+
+ if(len > 0 && bk_stream_play_rb) {
+ int timerout = 2000;
+ while(1)
+ {
+ timerout--;
+ if(timerout <=0 ||(helios_rb_data_len(bk_stream_play_rb) + len < ring_buf_len))
+ break;
+ aos_sleep(1);
+ }
+ int write_actual_len = helios_rb_write(bk_stream_play_rb, data, len);
+ return write_actual_len;
+ }
+ return 0;
+}
\ No newline at end of file
--- /dev/null
+#ifndef __STREAM_PLAY_H__
+#define __STREAM_PLAY_H__
+#include "aic_osa.h"
+int bk_stream_play_start(void);
+int bk_stream_play_write(char *data ,u32 len);
+#endif
\ No newline at end of file
-cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)\r
-\r
-# Set up the project\r
-project(aic_apps\r
- VERSION 1.0.0\r
- LANGUAGES C\r
-)\r
-\r
-#\r
-# Create Library and add Curent Library to project library list\r
-#\r
-aic_library_named(${PROJECT_NAME})\r
-\r
-file(GLOB SOURCES ./*.c)\r
-\r
-aic_library_include_directories(\r
- ${AIC_SOURCE_ROOT}/app/\r
- ${AIC_SOURCE_ROOT}/app/util\r
- ${AIC_SOURCE_ROOT}/app/util/backlight/\r
- ${AIC_SOURCE_ROOT}/app/util/factoryreset/\r
- ${AIC_SOURCE_ROOT}/app/util/audio/\r
- ${AIC_SOURCE_ROOT}/app/util/sleep/\r
- ${AIC_SOURCE_ROOT}/app/em/\r
- ${AIC_SOURCE_ROOT}/app/idle/\r
- ${AIC_SOURCE_ROOT}/app/call/\r
- ${AIC_SOURCE_ROOT}/app/settings/\r
- ${AIC_SOURCE_ROOT}/app/photo/\r
- ${AIC_SOURCE_ROOT}/app/camera/\r
- ${AIC_SOURCE_ROOT}/app/audiofocus/\r
- ${AIC_SOURCE_ROOT}/app/recorder/\r
- ${AIC_SOURCE_ROOT}/app/fota/\r
- ${AIC_SOURCE_ROOT}/app/resource\r
- ${AIC_SOURCE_ROOT}/app/resource/ring\r
- ${AIC_SOURCE_ROOT}/app/sms_test\r
- ${AIC_SOURCE_ROOT}/app/notify_center\r
- ${AIC_SOURCE_ROOT}/app/usb\r
-)\r
-\r
-aic_library_include_directories(\r
- ${AIC_SOURCE_ROOT}/app/widgets/\r
- ${AIC_SOURCE_ROOT}/app/idle_fp/\r
- ${AIC_SOURCE_ROOT}/app/home_fp/\r
- ${AIC_SOURCE_ROOT}/app/phonebook_fp/\r
- ${AIC_SOURCE_ROOT}/app/sms_fp/\r
- ${AIC_SOURCE_ROOT}/app/settings_fp/\r
- ${AIC_SOURCE_ROOT}/app/settings_fp/flow\r
- ${AIC_SOURCE_ROOT}/app/calllog_fp/\r
- ${AIC_SOURCE_ROOT}/app/call_fp/\r
- ${AIC_SOURCE_ROOT}/app/tools_fp/\r
- ${AIC_SOURCE_ROOT}/app/multimedia_fp/\r
- ${AIC_SOURCE_ROOT}/app/remind_fp/\r
-)\r
-\r
-aic_library_sources_ifdef(\r
- CONFIG_APP_ENTRY_NOGUI\r
- ./app_nogui.c\r
- ./app_msg.c\r
- ${AIC_SOURCE_ROOT}/app/util/audio/app_audio.c\r
- ${AIC_SOURCE_ROOT}/app/util/audio/app_audio_mp3.c\r
- ${AIC_SOURCE_ROOT}/app/util/audio/app_tts.c\r
-)\r
-\r
-aic_library_sources_ifndef(\r
- CONFIG_APP_ENTRY_NOGUI\r
- ./app.c\r
- ./app_msg.c\r
-)\r
-\r
-if(NOT CONFIG_APP_ENTRY_NOGUI)\r
-\r
- add_subdirectory(resource)\r
- add_subdirectory(bootanimation)\r
- add_subdirectory(lvgl_demo_apps)\r
- add_subdirectory(em)\r
- add_subdirectory(util)\r
- add_subdirectory(idle)\r
- add_subdirectory(notify_center)\r
- add_subdirectory(call)\r
- add_subdirectory(filebrowser)\r
- add_subdirectory(fota)\r
- add_subdirectory(usb)\r
- add_subdirectory(app_comp)\r
- add_subdirectory(photo)\r
- add_subdirectory(camera)\r
- add_subdirectory(audiofocus)\r
- add_subdirectory(recorder)\r
- add_subdirectory(settings)\r
- add_subdirectory(sms_test)\r
-\r
- add_subdirectory(widgets)\r
- add_subdirectory(idle_fp)\r
- add_subdirectory(home_fp)\r
- add_subdirectory(phonebook_fp)\r
- add_subdirectory(sms_fp)\r
- add_subdirectory(settings_fp)\r
- add_subdirectory(calllog_fp)\r
- add_subdirectory(call_fp)\r
- add_subdirectory(tools_fp)\r
- add_subdirectory(multimedia_fp)\r
- add_subdirectory(remind_fp)\r
-\r
-#\r
-# Create Library and add Curent Library to project library list\r
-# aic_sdk_library is register close source code library\r
-# Note!!!!!!\r
-# The following code would be close source code\r
-aic_sdk_library(app_flow)\r
-\r
-if(NOT CONFIG_SDK_ENABLE)\r
- aic_library_include_directories(\r
- ${AIC_SOURCE_ROOT}/app/\r
- ${AIC_SOURCE_ROOT}/app/util\r
- ${AIC_SOURCE_ROOT}/app/util/backlight/\r
- ${AIC_SOURCE_ROOT}/app/util/factoryreset/\r
- ${AIC_SOURCE_ROOT}/app/util/audio/\r
- ${AIC_SOURCE_ROOT}/app/util/sleep/\r
- ${AIC_SOURCE_ROOT}/app/idle/flow/\r
- ${AIC_SOURCE_ROOT}/app/call/flow/\r
- ${AIC_SOURCE_ROOT}/app/settings/flow/\r
- ${AIC_SOURCE_ROOT}/app/resource/ring\r
- ${AIC_SOURCE_ROOT}/app/usb/flow/\r
- ${AIC_SOURCE_ROOT}/app/call\r
- ${AIC_SOURCE_ROOT}/app/app_comp/statusbar/flow\r
- )\r
-\r
- set(SRCS\r
- ${AIC_SOURCE_ROOT}/app/idle/flow/idle_flow.c\r
- ${AIC_SOURCE_ROOT}/app/call/flow/call_flow.c\r
- ${AIC_SOURCE_ROOT}/app/settings/flow/settings_flow.c\r
- ${AIC_SOURCE_ROOT}/app/usb/flow/usb_flow.c\r
- ${AIC_SOURCE_ROOT}/app/app_comp/statusbar/flow/statusbar_flow.c\r
- )\r
-\r
- aic_library_sources(${SRCS})\r
-endif()\r\r
-endif()\r
-\r
-add_subdirectory(samples)\r
+cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
+
+# Set up the project
+project(aic_apps
+ VERSION 1.0.0
+ LANGUAGES C
+)
+
+#
+# Create Library and add Curent Library to project library list
+#
+aic_library_named(${PROJECT_NAME})
+
+file(GLOB SOURCES ./*.c)
+
+aic_library_include_directories(
+ ${AIC_SOURCE_ROOT}/app/
+ ${AIC_SOURCE_ROOT}/app/util
+ ${AIC_SOURCE_ROOT}/app/util/backlight/
+ ${AIC_SOURCE_ROOT}/app/util/factoryreset/
+ ${AIC_SOURCE_ROOT}/app/util/audio/
+ ${AIC_SOURCE_ROOT}/app/util/sleep/
+ ${AIC_SOURCE_ROOT}/app/em/
+ ${AIC_SOURCE_ROOT}/app/idle/
+ ${AIC_SOURCE_ROOT}/app/call/
+ ${AIC_SOURCE_ROOT}/app/settings/
+ ${AIC_SOURCE_ROOT}/app/photo/
+ ${AIC_SOURCE_ROOT}/app/camera/
+ ${AIC_SOURCE_ROOT}/app/audiofocus/
+ ${AIC_SOURCE_ROOT}/app/recorder/
+ ${AIC_SOURCE_ROOT}/app/fota/
+ ${AIC_SOURCE_ROOT}/app/resource
+ ${AIC_SOURCE_ROOT}/app/resource/ring
+ ${AIC_SOURCE_ROOT}/app/sms_test
+ ${AIC_SOURCE_ROOT}/app/notify_center
+ ${AIC_SOURCE_ROOT}/app/usb
+ ${AIC_SOURCE_ROOT}/app/AI_AMP_2_5
+)
+
+aic_library_include_directories(
+ ${AIC_SOURCE_ROOT}/app/widgets/
+ ${AIC_SOURCE_ROOT}/app/idle_fp/
+ ${AIC_SOURCE_ROOT}/app/home_fp/
+ ${AIC_SOURCE_ROOT}/app/phonebook_fp/
+ ${AIC_SOURCE_ROOT}/app/sms_fp/
+ ${AIC_SOURCE_ROOT}/app/settings_fp/
+ ${AIC_SOURCE_ROOT}/app/settings_fp/flow
+ ${AIC_SOURCE_ROOT}/app/calllog_fp/
+ ${AIC_SOURCE_ROOT}/app/call_fp/
+ ${AIC_SOURCE_ROOT}/app/tools_fp/
+ ${AIC_SOURCE_ROOT}/app/multimedia_fp/
+ ${AIC_SOURCE_ROOT}/app/remind_fp/
+)
+
+aic_library_sources_ifdef(
+ CONFIG_APP_ENTRY_NOGUI
+ ./app_nogui.c
+ ./app_msg.c
+ ${AIC_SOURCE_ROOT}/app/util/audio/app_audio.c
+ ${AIC_SOURCE_ROOT}/app/util/audio/app_audio_mp3.c
+ ${AIC_SOURCE_ROOT}/app/util/audio/app_tts.c
+)
+
+aic_library_sources_ifndef(
+ CONFIG_APP_ENTRY_NOGUI
+ ./app.c
+ ./app_msg.c
+)
+add_subdirectory(AI_AMP_2_5)
+if(NOT CONFIG_APP_ENTRY_NOGUI)
+
+ add_subdirectory(resource)
+ add_subdirectory(bootanimation)
+ add_subdirectory(lvgl_demo_apps)
+ add_subdirectory(em)
+ add_subdirectory(util)
+ add_subdirectory(idle)
+ add_subdirectory(notify_center)
+ add_subdirectory(call)
+ add_subdirectory(filebrowser)
+ add_subdirectory(fota)
+ add_subdirectory(usb)
+ add_subdirectory(app_comp)
+ add_subdirectory(photo)
+ add_subdirectory(camera)
+ add_subdirectory(audiofocus)
+ add_subdirectory(recorder)
+ add_subdirectory(settings)
+ add_subdirectory(sms_test)
+
+
+ add_subdirectory(widgets)
+ add_subdirectory(idle_fp)
+ add_subdirectory(home_fp)
+ add_subdirectory(phonebook_fp)
+ add_subdirectory(sms_fp)
+ add_subdirectory(settings_fp)
+ add_subdirectory(calllog_fp)
+ add_subdirectory(call_fp)
+ add_subdirectory(tools_fp)
+ add_subdirectory(multimedia_fp)
+ add_subdirectory(remind_fp)
+
+#
+# Create Library and add Curent Library to project library list
+# aic_sdk_library is register close source code library
+# Note!!!!!!
+# The following code would be close source code
+aic_sdk_library(app_flow)
+
+if(NOT CONFIG_SDK_ENABLE)
+ aic_library_include_directories(
+ ${AIC_SOURCE_ROOT}/app/
+ ${AIC_SOURCE_ROOT}/app/util
+ ${AIC_SOURCE_ROOT}/app/util/backlight/
+ ${AIC_SOURCE_ROOT}/app/util/factoryreset/
+ ${AIC_SOURCE_ROOT}/app/util/audio/
+ ${AIC_SOURCE_ROOT}/app/util/sleep/
+ ${AIC_SOURCE_ROOT}/app/idle/flow/
+ ${AIC_SOURCE_ROOT}/app/call/flow/
+ ${AIC_SOURCE_ROOT}/app/settings/flow/
+ ${AIC_SOURCE_ROOT}/app/resource/ring
+ ${AIC_SOURCE_ROOT}/app/usb/flow/
+ ${AIC_SOURCE_ROOT}/app/call
+ ${AIC_SOURCE_ROOT}/app/app_comp/statusbar/flow
+ )
+
+ set(SRCS
+ ${AIC_SOURCE_ROOT}/app/idle/flow/idle_flow.c
+ ${AIC_SOURCE_ROOT}/app/call/flow/call_flow.c
+ ${AIC_SOURCE_ROOT}/app/settings/flow/settings_flow.c
+ ${AIC_SOURCE_ROOT}/app/usb/flow/usb_flow.c
+ ${AIC_SOURCE_ROOT}/app/app_comp/statusbar/flow/statusbar_flow.c
+ )
+
+ aic_library_sources(${SRCS})
+endif()
+
+endif()
+
+add_subdirectory(samples)
help
Enable USB APP
+config APP_AI_AMP_2_5
+ bool "Enable AI_AMP_2_5"
+ #select
+ default y
+ help
+ Enable AI_AMP_2_5
+
endmenu #menu "Enable APPs "
#include <aic_osa_ex.h>
#include <aos_thread.h>
#include "app_msg.h"
+#include "aic_at_process_common.h"
+#if defined(CONFIG_AICHAT_SUPPORT) && defined(CONFIG_AICHAT_KEY_BOARD_SUPPORT)
+#include "aichat_ui_events.h"
+#include "aic_net_pdp_mgr.h"
+
+static void AppEntryAichatInit(void* thread_input)
+{
+ app_logi("[%s] in.", __func__);
+
+ aichat_key_init();
+
+ if (NULL == aichat_ui_init(0)) {
+ app_loge("[%s]: fail to aichat_ui_init.", __func__);
+ }
+
+ app_logi("[%s] out.", __func__);
+}
+
+void app_pdp_state_change_callback(u8 pdp_cid, u8 pdp_state)
+{
+ if (pdp_cid != 1) {
+ app_loge("[no_gui]error pdp_cid %d. \n", pdp_cid);
+ return;
+ }
+
+ if (1 == pdp_state) {
+ app_logi("[no_gui]pdp actived. \n");
+ aos_create_thread("app_no_gui_aichat_task", AppEntryAichatInit,
+ NULL, 8192, 0, NULL, 10, AOS_AUTO_START);
+ }
+ else {
+ app_logi("[no_gui]pdp deactived. \n");
+ }
+}
+#else
#define APP_CFG_TASK_STK_SIZE (4096u)
#define APP_CFG_TASK_COM_PRIO (35u)
-typedef int32_t (*srv_func_callback)(void *p_param, uint32_t size); // TODO: temp and common define this
+typedef int32_t(*srv_func_callback)(void* p_param, uint32_t size); // TODO: temp and common define this
/* Entry point for application, custom this function to meet your requirement */
-static void AppEntryNoGUI(void *thread_input)
+static void AppEntryNoGUI(void* thread_input)
{
/* Initial API of APP, you can add your code here. */
//app_demo_init();
uint32_t ret = 0;
- app_callback_msg_t recv_msg = {0};
+ app_callback_msg_t recv_msg = { 0 };
while (1) {
app_logi("Application entry point!\n");
/* 15 seconds */
ret = app_msg_recv(&recv_msg, 15000);
- if( AOS_QUEUE_EMPTY == ret ) {
+ if (AOS_QUEUE_EMPTY == ret) {
continue;
}
else {
switch (recv_msg.msg_id) {
- case 0xAAAAAAAA:
- {
- srv_func_callback p_cb = (srv_func_callback)recv_msg.p_func_callback;
- if(NULL != p_cb) {
- p_cb(recv_msg.p_param, recv_msg.size);
- }
-
- /* free recieved msg */
- if(NULL != recv_msg.p_param) {
- aic_free(recv_msg.p_param);
- }
- }
- break;
- default:
- app_logi("Recive a APP msg which is NOT known. \n");
- break;
+ case 0xAAAAAAAA:
+ {
+ srv_func_callback p_cb = (srv_func_callback)recv_msg.p_func_callback;
+ if (NULL != p_cb) {
+ p_cb(recv_msg.p_param, recv_msg.size);
+ }
+
+ /* free recieved msg */
+ if (NULL != recv_msg.p_param) {
+ aic_free(recv_msg.p_param);
+ }
+ }
+ break;
+ default:
+ app_logi("Recive a APP msg which is NOT known. \n");
+ break;
}
}
}
}
+#endif
int app_init(void)
{
+ app_logi("[%s] in.", __func__);
/* Initial app msg queue for extern event handle and dispatch. */
app_msg_init();
+#if defined(CONFIG_AICHAT_SUPPORT) && defined(CONFIG_AICHAT_KEY_BOARD_SUPPORT)
+ aic_register_pdp_state_change_cb(app_pdp_state_change_callback);
+#else
aos_create_thread(
"app_no_gui_task",
AppEntryNoGUI,
NULL,
APP_CFG_TASK_COM_PRIO,
AOS_AUTO_START);
+#endif
+
+ app_logi("[%s] out.", __func__);
return AIC_SUCCESS;
}
AIC_NORMAL_APP_P2_INIT_EXPORT(app_init);
-
--- /dev/null
+// This file was generated by SquareLine Studio
+// SquareLine Studio version: SquareLine Studio 1.3.4
+// LVGL version: 8.3.3
+// Project name: app_ai
+
+#ifndef _AICHAT_UI_EVENTS_H
+#define _AICHAT_UI_EVENTS_H
+
+#include "aichat_agent_mnger.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ typedef enum app_aichat_status {
+ APP_AICHAT_INIT_SUCCESS = 1,
+ APP_AICHAT_INIT_FAIL,
+ APP_AICHAT_START_SUCCESS,
+ APP_AICHAT_START_FAIL,
+ APP_AICHAT_STOP_SUCCESS,
+ APP_AICHAT_STOP_FAIL,
+ APP_AICHAT_STORAGE_FULL,
+ APP_AICHAT_VOICE_CLONE_SUCCESS,
+ APP_AICHAT_VOICE_UPDATE_SUCCESS,
+ APP_AICHAT_VOICE_QUERY_SUCCESS,
+ APP_AICHAT_VOICE_DELETE_SUCCESS,
+ APP_AICHAT_VOICE_QUERY_ONE_SUCCESS,
+ APP_AICHAT_ASR_DONE,
+ APP_AICHAT_ASR_FAIL,
+ APP_AICHAT_LLM_DONE,
+ APP_AICHAT_LLM_FAIL,
+ APP_AICHAT_TTS_DONE,
+ APP_AICHAT_TTS_FAIL,
+ APP_AICHAT_DEEP_SLEEP,
+ APP_AICHAT_MAX
+ } app_aichat_status_e;
+
+ enum app_role_id {
+ APP_ROLE_A = 0,
+ APP_ROLE_B,
+ APP_ROLE_C,
+ APP_ROLE_MAX
+ };
+
+ typedef enum {
+ AICHAT_UI_EVENT_INIT,
+ AICHAT_UI_EVENT_DEINIT,
+ AICHAT_UI_EVENT_DEEP_SLEEP,
+ AICHAT_UI_EVENT_MAX
+ } aichat_ui_event_e;
+
+ typedef enum {
+ AICHAT_UI_STATE_INIT,
+ AICHAT_UI_STATE_INIT_FAIL,
+ AICHAT_UI_STATE_MAX
+ } aichat_ui_state_e;
+
+ struct aichat_ui_queue_item {
+ aichat_ui_event_e aichat_ui_event;
+ uint32_t resv[3];
+ };
+
+ typedef struct aichat_ui_context {
+ volatile app_aichat_status_e state;
+ aos_queue_ptr aichat_ui_queue;
+
+ uint32_t cur_role;
+ //volatile app_aichat_status_e agent_state;
+
+ struct agent_mnger_context* aichat_mnger_handle;
+
+ role_info_t* system_role;
+ char* clone_voice_id;
+ volatile int32_t asr_is_end;
+
+ aos_thread_id aichat_ui_thread_id;
+ } aichat_ui_context_t;
+
+ //int aichat_key_init(void);
+
+ void* aichat_ui_init(uint32_t role_id);
+ void aichat_ui_deinit(void* handle);
+ int32_t aichat_ui_btn_pressed(void* handle, uint32_t role_id, uint32_t is_long_pressed);
+ app_aichat_status_e aichat_ui_get_status(void* handle);
+ int32_t aichat_ui_asr_is_end(void* handle);
+ int aichat_key_init(void);
+
+#ifdef __cplusplus
+} /*extern "C"*/
+#endif
+
+#endif
* Time:
* Oct 26 2022 08:00:45
*/
-#define AIC_SW_VERSION "v25.007"
+#define AIC_SW_VERSION "v25.008"
#define AIC_SW_BRANCH "zwytco_v24.025"
#ifdef CONFIG_SUBSYS_CP
return chan_id;
}
#ifdef CONFIG_SUBSYS_AP
+int EIPU_FindMode(u32 eiu_index)
+{
+ EIPU_MODE_TYPE_E sec_mode = NOSEC_MODE;
+
+ switch (eiu_index)
+ {
+ case 0:
+ case 2:
+ case 3:
+ sec_mode = ND_MODE;
+ break;
+ case 1:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ sec_mode = NOSEC_MODE;
+ break;
+ default:
+ AIC_ASSERT(0);
+ break;
+ }
+
+ return sec_mode;
+}
+
+
int EIPU_FindIndex(u32 eiu_index, EIPU_MODE_TYPE_E sec_mode)
{
u32 pin_index = 0;
u32 chn = 0;
u32 eipu_max = sizeof(eipu_bd_cfg) / sizeof(*eipu_bd_cfg);
- offset = EIPU_Getoffset(sec_mode);
-
#ifdef CONFIG_SUBSYS_AP
+ sec_mode = EIPU_FindMode(eiu_index);
+
if (eipu_max == 1) {
if (sec_mode == ND_MODE)
chn = eipu_bd_cfg[0].chn;
}
#endif
+ offset = EIPU_Getoffset(sec_mode);
+
chan_id = EIPU_FindBit(eiu_index);
if(chan_id >= chn) {
{
u32 result = AIC_ENOENT;
+#ifdef CONFIG_SUBSYS_AP
+ sec_mode = EIPU_FindMode(chan_id);
+#endif
+
s_eipu_int_table[sec_mode][chan_id].wk_mode = work_mode;
result = EIPU_RegCallback(chan_id,eipu_type,callback,trg_type_e,dbnc_cnt_ms,sec_mode);
return sec_mode;
}
+#ifdef CONFIG_SUBSYS_AP
+u32 EIPU_GetIndata_Ex(u32 pin_idx)
+{
+ return EIPU_GetIndata(0, 0, pin_idx);
+}
+#endif
+
u32 EIPU_GetIndata(EIPU_MODE_TYPE_E sec_mode,EIPU_FUNC_TYPE_E eipu_type,u32 pin_idx)
{
u32 offset;
#ifdef CONFIG_SUBSYS_AP
u32 chn_id;
+ sec_mode = EIPU_FindMode(pin_idx);
chn_id = EIPU_FindBit(pin_idx);
offset = EIPU_Getoffset(sec_mode);
#ifdef CONFIG_SUBSYS_AP
u32 chn_id;
+ sec_mode = EIPU_FindMode(pin_idx);
chn_id = EIPU_FindBit(pin_idx);
offset = EIPU_Getoffset(sec_mode);
void EIPU_SetSel(u32 chn_id,u32 chn_sel);
u32 EIPU_GetBase(EIPU_MODE_TYPE_E sec_mode);
u32 EIPU_GetIndata(EIPU_MODE_TYPE_E sec_mode,EIPU_FUNC_TYPE_E eipu_type,u32 chn_id);
-
+#ifdef CONFIG_SUBSYS_AP
+u32 EIPU_GetIndata_Ex(u32 pin_idx);
+#endif
#endif /* __EIPU_H__ */
pmic_writel(0x23c, val);
ret = RCO32K_CALI_TIMEOUT;
- } else if ((val < 8) || (pmic_readl(0x23c) & BIT(1))) {
+ } else if (pmic_readl(0x23c) & BIT(1)) {
aic_gp202_rc32k_switch_to_sw_cali();
ret = RCO32K_CALI_SUCCESS;
} else {
aicx_error(0x117748, "", "rc32k calibration timeout!\n");
tmp = pmic_readl(0x244);
tmp |= 0x4;
- pmic_writel(0x244, val);
+ pmic_writel(0x244, tmp);
tmp &= ~0x4;
- pmic_writel(0x244, val);
+ pmic_writel(0x244, tmp);
+ AIC_ASSERT(0);
return -1;
}
- if ((val < 128) || (val & BIT(1))) {
+ if (val2 & BIT(1)) {
aicx_info(0x04afdf, "", "rc32k calibration success!\n");
break;
}
pmic_writel(rtc_base + REG_RTC_CFG_TIME, val);
pmic_writel(rtc_base + REG_RTC_CFG_DAY, tm->tm_day);
pmic_writel(rtc_base + REG_RTC_UPDATE, BIT_RTC_TIME_UPDATE);
- /* it should delay 700us, because rtc work in 4KHz */
- aic_udelay(700);
+ /* wait update completed */
+ do {
+ val = pmic_readl(rtc_base + REG_RTC_INT_STS_RAW);
+ } while (!(val & BIT(4)));
+ pmic_writel(rtc_base + REG_RTC_INT_CLR, BIT(4));
}
void gx_rtc_pmic_phy_alarm_enable(BOOL enable)
pmic_writel(rtc_base + REG_RTC_TIME_ALARM1, val);
pmic_writel(rtc_base + REG_RTC_DAY_ALARM1, ta->tm_day);
pmic_writel(rtc_base + REG_RTC_ALARM1_CFG_DONE, BIT_RTC_ALARM1_CFG_DONE);
+ /* wait update completed */
+ do {
+ val = pmic_readl(rtc_base + REG_RTC_INT_STS_RAW);
+ } while (!(val & BIT(5)));
+ pmic_writel(rtc_base + REG_RTC_INT_CLR, BIT(5));
}
void gx_rtc_pmic_phy_del_alarm(void)
{
+ u32 val;
+
pmic_writel(rtc_base + REG_RTC_ALARM1_EN, 0);
pmic_writel(rtc_base + REG_RTC_TIME_ALARM1, 0);
pmic_writel(rtc_base + REG_RTC_DAY_ALARM1, 0);
pmic_writel(rtc_base + REG_RTC_ALARM1_CFG_DONE, BIT_RTC_ALARM1_CFG_DONE);
+ /* wait update completed */
+ do {
+ val = pmic_readl(rtc_base + REG_RTC_INT_STS_RAW);
+ } while (!(val & BIT(5)));
+ pmic_writel(rtc_base + REG_RTC_INT_CLR, BIT(5));
}
void gx_rtc_pmic_phy_init(void)
pmic_writel(rtc_base + REG_RTC_CFG_TIME, val);
pmic_writel(rtc_base + REG_RTC_CFG_DAY, tm->tm_day);
pmic_writel(rtc_base + REG_RTC_UPDATE, BIT_RTC_TIME_UPDATE);
- /* it should delay 700us, because rtc work in 4KHz */
- aic_udelay(700);
+ /* wait update completed */
+ do {
+ val = pmic_readl(rtc_base + REG_RTC_INT_STS_RAW);
+ } while (!(val & BIT(4)));
+ pmic_writel(rtc_base + REG_RTC_INT_CLR, BIT(4));
+ /* there needs 1 cycle to int clear handshake */
+ aic_udelay(10000);
}
void gx_rtc_pmic_phy_alarm_enable(BOOL enable)
pmic_writel(rtc_base + REG_RTC_TIME_ALARM1, val);
pmic_writel(rtc_base + REG_RTC_DAY_ALARM1, ta->tm_day);
pmic_writel(rtc_base + REG_RTC_ALARM1_CFG_DONE, BIT_RTC_ALARM1_CFG_DONE);
+ /* wait update completed */
+ do {
+ val = pmic_readl(rtc_base + REG_RTC_INT_STS_RAW);
+ } while (!(val & BIT(5)));
+ pmic_writel(rtc_base + REG_RTC_INT_CLR, BIT(5));
+ /* there needs 1 cycle to int clear handshake */
+ aic_udelay(10000);
}
void gx_rtc_pmic_phy_del_alarm(void)
{
+ u32 val;
+
pmic_writel(rtc_base + REG_RTC_ALARM1_EN, 0);
pmic_writel(rtc_base + REG_RTC_TIME_ALARM1, 0);
pmic_writel(rtc_base + REG_RTC_DAY_ALARM1, 0);
pmic_writel(rtc_base + REG_RTC_ALARM1_CFG_DONE, BIT_RTC_ALARM1_CFG_DONE);
+ /* wait update completed */
+ do {
+ val = pmic_readl(rtc_base + REG_RTC_INT_STS_RAW);
+ } while (!(val & BIT(5)));
+ pmic_writel(rtc_base + REG_RTC_INT_CLR, BIT(5));
+ /* there needs 1 cycle to int clear handshake */
+ aic_udelay(10000);
}
void gx_rtc_pmic_phy_init(void)
void *g_alarm_param;
RTC_CB g_rtc_chg_cb;
void *g_rtc_chg_param;
+static aos_mutex_ptr g_rtc_mutex;
#endif
addr_t rtc_sh_ptr;
void gx_rtc_set_time(struct rtc_time *tm)
{
+ int ret;
u32 days;
if (rtc_valid_tm(tm))
tm->tm_day = days;
+ ret = aos_get_mutex(g_rtc_mutex, AOS_WAIT_FOREVER);
+ AIC_ASSERT(ret == AOS_SUCCESS);
+
gx_rtc_pmic_phy_set_time(tm);
+ aos_put_mutex(g_rtc_mutex);
+
if (g_rtc_chg_cb != NULL) {
g_rtc_chg_cb(g_rtc_chg_param);
}
void gx_rtc_set_alarm(struct rtc_time *ra, RTC_ALARM_CB cb, void *param)
{
u32 days;
+ int ret;
alog_info("RTC set alarm %d %d %d %d:%d:%d\n", ra->tm_year, ra->tm_mon,
ra->tm_day, ra->tm_hour, ra->tm_min, ra->tm_sec);
ra->tm_day = days;
+ ret = aos_get_mutex(g_rtc_mutex, AOS_WAIT_FOREVER);
+ AIC_ASSERT(ret == AOS_SUCCESS);
+
gx_rtc_pmic_phy_set_alarm(ra);
#ifdef CONFIG_ALARM_BELT
aic_alarm_belt();
#endif
+
+ aos_put_mutex(g_rtc_mutex);
+
}
void gx_rtc_alarm_enable(BOOL enable)
void gx_rtc_del_alarm(void)
{
+ int ret;
+
+ ret = aos_get_mutex(g_rtc_mutex, AOS_WAIT_FOREVER);
+ AIC_ASSERT(ret == AOS_SUCCESS);
+
gx_rtc_pmic_phy_del_alarm();
+
+ aos_put_mutex(g_rtc_mutex);
}
#ifdef CONFIG_FP
struct rtc_time tm = {0};
AMSG_T msg;
+ g_rtc_mutex = aos_create_mutex("rtc");
+ AIC_ASSERT(g_rtc_mutex);
+
gx_rtc_pmic_phy_init();
register_pmic_irq(PMIC_IRQ_RTC, gx_rtc_irq_handler, NULL);
void aic_uart_stop_tx(void *dev)
{
struct aic_uart *auart = (struct aic_uart *)dev;
+ u32 ctrl;
AIC_WRITE32(auart->base + SERIAL_IDR, SERIAL_INT_TTRIG | SERIAL_TEMPTY);
- if (auart->tdmaeb)
+ if (auart->tdmaeb) {
+ ctrl = AIC_READ32(auart->base + SERIAL_CTRL);
+ ctrl &= ~SERIAL_DMA_TXEN;
+ AIC_WRITE32(auart->base + SERIAL_CTRL, ctrl);
aic_dma_chn_free(auart->tdmachn);
+ }
}
void aic_uart_tx(struct uart_port *up, u32 status)
void aic_uart_stop_rx(void *dev)
{
struct aic_uart *auart = (struct aic_uart *)dev;
+ u32 ctrl;
AIC_WRITE32(auart->base + SERIAL_IDR, SERIAL_RTRIG | SERIAL_TIMEOUT);
- if (auart->rdmaeb)
+ if (auart->rdmaeb) {
+ aic_dma_chn_suspend(auart->rdmachn);
+ ctrl = AIC_READ32(auart->base + SERIAL_CTRL);
+ ctrl &= ~SERIAL_DMA_RXEN;
+ AIC_WRITE32(auart->base + SERIAL_CTRL, ctrl);
+ aic_dma_chn_resume(auart->rdmachn);
aic_dma_chn_free(auart->rdmachn);
+ }
}
void aic_uart_rx(struct uart_port *up, u32 status)
void aic_uart_stop_tx(void *dev)
{
struct aic_uart *auart = (struct aic_uart *)dev;
+ u32 ctrl;
AIC_WRITE32(auart->base + SERIAL_IDR, SERIAL_INT_TTRIG | SERIAL_TEMPTY);
- if (auart->tdmaeb)
+ if (auart->tdmaeb) {
+ ctrl = AIC_READ32(auart->base + SERIAL_CTRL);
+ ctrl &= ~SERIAL_DMA_TXEN;
+ AIC_WRITE32(auart->base + SERIAL_CTRL, ctrl);
aic_dma_chn_free(auart->tdmachn);
+ }
}
void aic_uart_tx(struct uart_port *up, u32 status)
void aic_uart_stop_rx(void *dev)
{
struct aic_uart *auart = (struct aic_uart *)dev;
+ u32 ctrl;
AIC_WRITE32(auart->base + SERIAL_IDR, SERIAL_RTRIG | SERIAL_TIMEOUT);
- if (auart->rdmaeb)
+ if (auart->rdmaeb) {
+ aic_dma_chn_suspend(auart->rdmachn);
+ ctrl = AIC_READ32(auart->base + SERIAL_CTRL);
+ ctrl &= ~SERIAL_DMA_RXEN;
+ AIC_WRITE32(auart->base + SERIAL_CTRL, ctrl);
+ aic_dma_chn_resume(auart->rdmachn);
aic_dma_chn_free(auart->rdmachn);
+ }
}
void aic_uart_rx(struct uart_port *up, u32 status)
ctrl = AIC_READ32(auart->base + SERIAL_CTRL);
if (auart->tdmaeb) {
- aic_dma_chn_free(auart->tdmachn);
ctrl &= ~SERIAL_DMA_TXEN;
AIC_WRITE32(auart->base + SERIAL_CTRL, ctrl);
+ aic_dma_chn_free(auart->tdmachn);
}
if (auart->rdmaeb) {
{
u32 val = 0x1;
+ /* switch to hw cali for shutdown cali */
+ val = pmic_readl(0x54);
+ val &= ~BIT(12);
+ pmic_writel(0x54, val);
+
+ val = pmic_readl(0x58);
+ val &= ~BIT(12);
+ pmic_writel(0x58, val);
+
+ val = pmic_readl(0x23c);
+ val |= BIT(2);
+ pmic_writel(0x23c, val);
+
sysoff_mode(SYSOFF_MODE_SHUTDOWN);
- pmic_writel(pmic_shutdown_tirgger_reg, val);
+ pmic_writel(pmic_shutdown_tirgger_reg, 1);
while(1);
}
}
CONSOLE_EXPORT_CMD(voip_stop, voip_test_stop, voip stop test);
-//u8 voip_test_buf[640 + 4];
+#ifdef CONFIG_AICHAT_SUPPORT
u8 voip1_test_state;
#include "app_audio.h"
aos_thread_id voip1_test_th;
return 0;
}
CONSOLE_EXPORT_CMD(voip1_stop, voip1_test_stop, voip1 stop test);
+#endif
#endif
#define SND_PA_CTRL_GPIO_NUM 27
#define SND_PA_CTRL_ON_GPIO_LEVEL 1
-#define SND_PMU_CODEC "VDDTCXO"
+#define SND_PMU_CODEC "DVDD3V"
#define SND_PMU_CODEC_IO NULL
-#define SND_PMU_CODEC_MICBIAS "DVDD3V"
+#define SND_PMU_CODEC_MICBIAS NULL
#define SND_PA_PMU_PRE_TIME 0
#define SND_PA_PMU_POST_TIME 10
#include <stdio.h>
#include <aic_cmdline.h>
-#define AIC_RELEASE_NUM "00007"
-#define AIC_BUILD_NUMBER "J44"
+#define AIC_RELEASE_NUM "00008"
+#define AIC_BUILD_NUMBER "J48"
struct aic_version s_version = {
.version = AIC_SW_VERSION,
/***************************** The gpio key config ***************************/
/*****************************************************************************/
-#define KEY_0_EIPU_INDEX (0)
-#define KEY_1_GPIO_INDEX (GPIO_1)
-#define KEY_2_GPIO_INDEX (GPIO_17)
-#define KEY_3_GPIO_INDEX (GPIO_AGPIO_3)
-#define KEY_4_GPIO_INDEX (GPIO_19)
+#define KEY_0_EIPU_INDEX (4)//EIU_INT4
+#define KEY_1_EIPU_INDEX (0)//EIU_INT0
+#define KEY_2_EIPU_INDEX (7)//EIU_INT7
+#define KEY_3_EIPU_INDEX (5)//EIU_INT5
gpio_key_config_t g_gpio_key_config[] = {
- /* config key as follow */
- {KEY_0, KEY_0_EIPU_INDEX, KEY_TYPE_EIPU},
- {KEY_1, KEY_1_GPIO_INDEX, KEY_TYPE_GPIO},
- {KEY_2, KEY_2_GPIO_INDEX, KEY_TYPE_GPIO},
- {KEY_3, KEY_3_GPIO_INDEX, KEY_TYPE_GPIO},
- {KEY_4, KEY_4_GPIO_INDEX, KEY_TYPE_GPIO},
+ /* config key as follow */
+ {KEY_0, KEY_0_EIPU_INDEX, KEY_TYPE_EIPU},// main key
+ {KEY_1, KEY_1_EIPU_INDEX, KEY_TYPE_EIPU},// volume up
+ {KEY_2, KEY_2_EIPU_INDEX, KEY_TYPE_EIPU},// volume down
+ {KEY_3, KEY_3_EIPU_INDEX, KEY_TYPE_EIPU},// reserved
+ //{KEY_4, KEY_4_GPIO_INDEX, KEY_TYPE_GPIO},
/* add key upside */
{0, 0, KEY_TYPE_MAX}
/*****************************************************************************/
/* */
-/* Copyright 2024 by AICXTEK TECHNOLOGIES CO.,LTD. All rights reserved. */
+/* Copyright 2025 by AICXTEK TECHNOLOGIES CO.,LTD. All rights reserved. */
/* */
/*****************************************************************************/
/* @@Platform: GX306 */
/* @@Author: */
/* @@Version: */
-/* @@Time: 2024/8/17 17:02:52 */
+/* @@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OP|BIT_PAD_SLP_WPD|BIT_PAD_SLP_Z},
+{REG_IOMUX_SPI_LCD_CLK, BIT_FUNC_SEL(3)},//SPI_LCD_CLK(NC)
+{REG_PG11_PAD_CTRL_SPI_LCD_CLK, BIT_PAD_DRV(1)|BIT_PAD_WPD|BIT_PAD_SLP_TOP|BIT_PAD_SLP_WPD|BIT_PAD_SLP_Z},
+{REG_IOMUX_LCD_FMARK, BIT_FUNC_SEL(3)},//LCD_FMARK(NC)
+{REG_PG11_PAD_CTRL_LCD_FMARK, BIT_PAD_DRV(1)|BIT_PAD_WPD|BIT_PAD_SLP_TOP|BIT_PAD_SLP_WPD|BIT_PAD_SLP_Z},
+{REG_IOMUX_LCD_RSTN, BIT_FUNC_SEL(3)},//LCD_RSTN(NC)
+{REG_PG11_PAD_CTRL_LCD_RSTN, BIT_PAD_DRV(1)|BIT_PAD_WPD|BIT_PAD_SLP_TOP|BIT_PAD_SLP_WPD|BIT_PAD_SLP_Z},
};
dig_pin_cfg_t g_dig_pinlist0[] = {
{GP202_IIC_CLK, BIT_GP202_PAD_DRV(1)|BIT_GP202_PAD_WPU},
{GP202_IO_MUX_IIC_DAT, BIT_FUNC_SEL(0)},//pmic IIC SDA
{GP202_IIC_DAT, BIT_GP202_PAD_DRV(1)|BIT_GP202_PAD_WPU},
-{GP202_IO_MUX_GPIO0, BIT_FUNC_SEL(2)},//ADC0
-{GP202_GPIO0, BIT_GP202_PAD_DRV(1)|BIT_GP202_PAD_PX},
-{GP202_IO_MUX_GPIO1, BIT_FUNC_SEL(2)},//ADC1
-{GP202_GPIO1, BIT_GP202_PAD_DRV(1)|BIT_GP202_PAD_PX},
-{GP202_IO_MUX_GPIO2, BIT_FUNC_SEL(1)},//RTC_IN
-{GP202_GPIO2, BIT_GP202_PAD_DRV(1)|BIT_GP202_PAD_PX},
-{GP202_IO_MUX_GPIO3, BIT_FUNC_SEL(0)},//KEYIN
-{GP202_GPIO3, BIT_GP202_PAD_DRV(1)|BIT_GP202_PAD_WPU},
+{GP202_IO_MUX_GPIO0, BIT_FUNC_SEL(0)},//ADC0(NC)
+{GP202_GPIO0, BIT_GP202_PAD_DRV(1)|BIT_GP202_PAD_WPD},
+{GP202_IO_MUX_GPIO1, BIT_FUNC_SEL(0)},//ADC1(NC)
+{GP202_GPIO1, BIT_GP202_PAD_DRV(1)|BIT_GP202_PAD_WPD},
+{GP202_IO_MUX_GPIO2, BIT_FUNC_SEL(0)},//RTC_IN(NC)
+{GP202_GPIO2, BIT_GP202_PAD_DRV(1)|BIT_GP202_PAD_WPD},
+{GP202_IO_MUX_GPIO3, BIT_FUNC_SEL(0)},//KEYIN(NC)
+{GP202_GPIO3, BIT_GP202_PAD_DRV(1)|BIT_GP202_PAD_WPD},
{GP202_IO_MUX_GPIO4, BIT_FUNC_SEL(0)},//NC
{GP202_GPIO4, BIT_GP202_PAD_DRV(1)|BIT_GP202_PAD_WPD},
};
CONFIG_DRIVER_GPO_VER="r1p0"
# end of GPO Drivers
-CONFIG_GRAPHICS=y
-CONFIG_DRIVER_LCDC=y
-CONFIG_SYNC_FLIP=y
-CONFIG_ST7789=y
-# CONFIG_GC9306 is not set
-# CONFIG_GC9307 is not set
-# CONFIG_IPS9107 is not set
-# CONFIG_ST7315 is not set
-# CONFIG_ST7365 is not set
-# CONFIG_ST7567 is not set
-# CONFIG_ST7735 is not set
-# CONFIG_AXS15231B is not set
-CONFIG_DRIVER_BACKLIGHT=y
-# CONFIG_KPLED_BACKLIGHT is not set
-# CONFIG_PWM_BACKLIGHT is not set
-CONFIG_PULSE_DIMMING_BACKLIGHT=y
-# CONFIG_LED_RGBW_BACKLIGHT is not set
-CONFIG_DISPLAY_SHOWLOGO=y
-CONFIG_AIC_DISPLAY_AT=y
-CONFIG_PANEL_POWER_PMIC=y
-# CONFIG_TP is not set
+# CONFIG_GRAPHICS is not set
CONFIG_HLZMA=y
CONFIG_DRIVER_HLZMA=y
CONFIG_DRIVER_HLZMA_VER="r1p0"
CONFIG_DRV_RTC_PMIC=y
CONFIG_DRV_RTC_PMIC_VER="gp202"
# CONFIG_STATUS_LIGHT is not set
-# CONFIG_TSC is not set
# CONFIG_PMIC_UPS is not set
#
# end of File System Test Select
# end of File System Config
-#
-# LVGL configuration
-#
-CONFIG_LV_CONF_SKIP=y
-# CONFIG_LV_CONF_MINIMAL is not set
-
-#
-# Color settings
-#
-# CONFIG_LV_COLOR_DEPTH_32 is not set
-CONFIG_LV_COLOR_DEPTH_16=y
-# CONFIG_LV_COLOR_DEPTH_8 is not set
-# CONFIG_LV_COLOR_DEPTH_1 is not set
-CONFIG_LV_COLOR_DEPTH=16
-# CONFIG_LV_COLOR_16_SWAP is not set
-CONFIG_LV_COLOR_MIX_ROUND_OFS=128
-CONFIG_LV_COLOR_CHROMA_KEY_HEX=0x00FF00
-# end of Color settings
-
-#
-# Memory settings
-#
-# CONFIG_LV_MEM_CUSTOM is not set
-CONFIG_LV_MEM_SIZE_KILOBYTES=32
-CONFIG_LV_MEM_ADDR=0x0
-CONFIG_LV_MEM_BUF_MAX_NUM=16
-# CONFIG_LV_MEMCPY_MEMSET_STD is not set
-# end of Memory settings
-
-#
-# HAL Settings
-#
-CONFIG_LV_DISP_DEF_REFR_PERIOD=30
-CONFIG_LV_INDEV_DEF_READ_PERIOD=30
-# CONFIG_LV_TICK_CUSTOM is not set
-CONFIG_LV_DPI_DEF=130
-# end of HAL Settings
-
-#
-# Feature configuration
-#
-
-#
-# Drawing
-#
-CONFIG_LV_DRAW_COMPLEX=y
-CONFIG_LV_SHADOW_CACHE_SIZE=0
-CONFIG_LV_CIRCLE_CACHE_SIZE=4
-CONFIG_LV_LAYER_SIMPLE_BUF_SIZE=24576
-CONFIG_LV_IMG_CACHE_DEF_SIZE=0
-CONFIG_LV_GRADIENT_MAX_STOPS=2
-CONFIG_LV_GRAD_CACHE_DEF_SIZE=0
-# CONFIG_LV_DITHER_GRADIENT is not set
-CONFIG_LV_DISP_ROT_MAX_BUF=10240
-# end of Drawing
-
-#
-# GPU
-#
-# CONFIG_LV_USE_GPU_ARM2D is not set
-# CONFIG_LV_USE_GPU_STM32_DMA2D is not set
-# CONFIG_LV_USE_GPU_RA6M3_G2D is not set
-# CONFIG_LV_USE_GPU_SWM341_DMA2D is not set
-# CONFIG_LV_USE_GPU_NXP_PXP is not set
-# CONFIG_LV_USE_GPU_NXP_VG_LITE is not set
-# CONFIG_LV_USE_GPU_SDL is not set
-# end of GPU
-
-#
-# Logging
-#
-# CONFIG_LV_USE_LOG is not set
-# end of Logging
-
-#
-# Asserts
-#
-CONFIG_LV_USE_ASSERT_NULL=y
-CONFIG_LV_USE_ASSERT_MALLOC=y
-# CONFIG_LV_USE_ASSERT_STYLE is not set
-# CONFIG_LV_USE_ASSERT_MEM_INTEGRITY is not set
-# CONFIG_LV_USE_ASSERT_OBJ is not set
-CONFIG_LV_ASSERT_HANDLER_INCLUDE="assert.h"
-# end of Asserts
-
-#
-# Others
-#
-# CONFIG_LV_USE_PERF_MONITOR is not set
-# CONFIG_LV_USE_MEM_MONITOR is not set
-# CONFIG_LV_USE_REFR_DEBUG is not set
-# CONFIG_LV_SPRINTF_CUSTOM is not set
-# CONFIG_LV_SPRINTF_USE_FLOAT is not set
-CONFIG_LV_USE_USER_DATA=y
-# CONFIG_LV_ENABLE_GC is not set
-# end of Others
-
-#
-# Compiler settings
-#
-# CONFIG_LV_BIG_ENDIAN_SYSTEM is not set
-CONFIG_LV_ATTRIBUTE_MEM_ALIGN_SIZE=1
-# CONFIG_LV_ATTRIBUTE_FAST_MEM_USE_IRAM is not set
-# CONFIG_LV_USE_LARGE_COORD is not set
-# end of Compiler settings
-# end of Feature configuration
-
-#
-# Font usage
-#
-
-#
-# Enable built-in fonts
-#
-# CONFIG_LV_FONT_MONTSERRAT_8 is not set
-# CONFIG_LV_FONT_MONTSERRAT_10 is not set
-# CONFIG_LV_FONT_MONTSERRAT_12 is not set
-CONFIG_LV_FONT_MONTSERRAT_14=y
-# CONFIG_LV_FONT_MONTSERRAT_16 is not set
-# CONFIG_LV_FONT_MONTSERRAT_18 is not set
-# CONFIG_LV_FONT_MONTSERRAT_20 is not set
-# CONFIG_LV_FONT_MONTSERRAT_22 is not set
-# CONFIG_LV_FONT_MONTSERRAT_24 is not set
-# CONFIG_LV_FONT_MONTSERRAT_26 is not set
-# CONFIG_LV_FONT_MONTSERRAT_28 is not set
-# CONFIG_LV_FONT_MONTSERRAT_30 is not set
-# CONFIG_LV_FONT_MONTSERRAT_32 is not set
-# CONFIG_LV_FONT_MONTSERRAT_34 is not set
-# CONFIG_LV_FONT_MONTSERRAT_36 is not set
-# CONFIG_LV_FONT_MONTSERRAT_38 is not set
-# CONFIG_LV_FONT_MONTSERRAT_40 is not set
-# CONFIG_LV_FONT_MONTSERRAT_42 is not set
-# CONFIG_LV_FONT_MONTSERRAT_44 is not set
-# CONFIG_LV_FONT_MONTSERRAT_46 is not set
-# CONFIG_LV_FONT_MONTSERRAT_48 is not set
-# CONFIG_LV_FONT_MONTSERRAT_12_SUBPX is not set
-# CONFIG_LV_FONT_MONTSERRAT_28_COMPRESSED is not set
-# CONFIG_LV_FONT_DEJAVU_16_PERSIAN_HEBREW is not set
-# CONFIG_LV_FONT_SIMSUN_16_CJK is not set
-# CONFIG_LV_FONT_UNSCII_8 is not set
-# CONFIG_LV_FONT_UNSCII_16 is not set
-# CONFIG_LV_FONT_CUSTOM is not set
-# end of Enable built-in fonts
-
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_8 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_12 is not set
-CONFIG_LV_FONT_DEFAULT_MONTSERRAT_14=y
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_16 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_18 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_20 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_22 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_24 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_26 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_28 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_30 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_32 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_34 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_36 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_38 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_40 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_42 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_44 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_46 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_48 is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_12_SUBPX is not set
-# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_28_COMPRESSED is not set
-# CONFIG_LV_FONT_DEFAULT_DEJAVU_16_PERSIAN_HEBREW is not set
-# CONFIG_LV_FONT_DEFAULT_SIMSUN_16_CJK is not set
-# CONFIG_LV_FONT_DEFAULT_UNSCII_8 is not set
-# CONFIG_LV_FONT_DEFAULT_UNSCII_16 is not set
-# CONFIG_LV_FONT_FMT_TXT_LARGE is not set
-# CONFIG_LV_USE_FONT_COMPRESSED is not set
-# CONFIG_LV_USE_FONT_SUBPX is not set
-CONFIG_LV_USE_FONT_PLACEHOLDER=y
-# end of Font usage
-
-#
-# Text Settings
-#
-CONFIG_LV_TXT_ENC_UTF8=y
-# CONFIG_LV_TXT_ENC_ASCII is not set
-CONFIG_LV_TXT_BREAK_CHARS=" ,.;:-_"
-CONFIG_LV_TXT_LINE_BREAK_LONG_LEN=0
-CONFIG_LV_TXT_COLOR_CMD="#"
-# CONFIG_LV_USE_BIDI is not set
-# CONFIG_LV_USE_ARABIC_PERSIAN_CHARS is not set
-# end of Text Settings
-
-#
-# Widget usage
-#
-CONFIG_LV_USE_ARC=y
-CONFIG_LV_USE_BAR=y
-CONFIG_LV_USE_BTN=y
-CONFIG_LV_USE_BTNMATRIX=y
-CONFIG_LV_USE_CANVAS=y
-CONFIG_LV_USE_CHECKBOX=y
-CONFIG_LV_USE_DROPDOWN=y
-CONFIG_LV_USE_IMG=y
-CONFIG_LV_USE_LABEL=y
-CONFIG_LV_LABEL_TEXT_SELECTION=y
-CONFIG_LV_LABEL_LONG_TXT_HINT=y
-CONFIG_LV_USE_LINE=y
-CONFIG_LV_USE_ROLLER=y
-CONFIG_LV_ROLLER_INF_PAGES=7
-CONFIG_LV_USE_SLIDER=y
-CONFIG_LV_USE_SWITCH=y
-CONFIG_LV_USE_TEXTAREA=y
-CONFIG_LV_TEXTAREA_DEF_PWD_SHOW_TIME=1500
-CONFIG_LV_USE_TABLE=y
-# end of Widget usage
-
-#
-# Extra Widgets
-#
-CONFIG_LV_USE_ANIMIMG=y
-CONFIG_LV_USE_CALENDAR=y
-# CONFIG_LV_CALENDAR_WEEK_STARTS_MONDAY is not set
-CONFIG_LV_USE_CALENDAR_HEADER_ARROW=y
-CONFIG_LV_USE_CALENDAR_HEADER_DROPDOWN=y
-CONFIG_LV_USE_CHART=y
-CONFIG_LV_USE_COLORWHEEL=y
-CONFIG_LV_USE_IMGBTN=y
-CONFIG_LV_USE_KEYBOARD=y
-CONFIG_LV_USE_LED=y
-CONFIG_LV_USE_LIST=y
-CONFIG_LV_USE_MENU=y
-CONFIG_LV_USE_METER=y
-CONFIG_LV_USE_MSGBOX=y
-CONFIG_LV_USE_SPAN=y
-CONFIG_LV_SPAN_SNIPPET_STACK_SIZE=64
-CONFIG_LV_USE_SPINBOX=y
-CONFIG_LV_USE_SPINNER=y
-CONFIG_LV_USE_TABVIEW=y
-CONFIG_LV_USE_TILEVIEW=y
-CONFIG_LV_USE_WIN=y
-# end of Extra Widgets
-
-#
-# Themes
-#
-CONFIG_LV_USE_THEME_DEFAULT=y
-# CONFIG_LV_THEME_DEFAULT_DARK is not set
-CONFIG_LV_THEME_DEFAULT_GROW=y
-CONFIG_LV_THEME_DEFAULT_TRANSITION_TIME=80
-CONFIG_LV_USE_THEME_BASIC=y
-# CONFIG_LV_USE_THEME_MONO is not set
-# end of Themes
-
-#
-# Layouts
-#
-CONFIG_LV_USE_FLEX=y
-CONFIG_LV_USE_GRID=y
-# end of Layouts
-
-#
-# 3rd Party Libraries
-#
-CONFIG_LV_USE_FS_STDIO=0
-CONFIG_LV_FS_STDIO_LETTER=0
-CONFIG_LV_FS_STDIO_PATH=""
-CONFIG_LV_FS_STDIO_CACHE_SIZE=0
-CONFIG_LV_USE_FS_POSIX=0
-CONFIG_LV_FS_POSIX_LETTER=0
-CONFIG_LV_FS_POSIX_PATH=""
-CONFIG_LV_FS_POSIX_CACHE_SIZE=0
-CONFIG_LV_USE_FS_WIN32=0
-CONFIG_LV_FS_WIN32_LETTER=0
-CONFIG_LV_FS_WIN32_PATH=""
-CONFIG_LV_FS_WIN32_CACHE_SIZE=0
-CONFIG_LV_USE_FS_FATFS=0
-CONFIG_LV_FS_FATFS_LETTER=0
-CONFIG_LV_FS_FATFS_CACHE_SIZE=0
-# CONFIG_LV_USE_PNG is not set
-# CONFIG_LV_USE_BMP is not set
-# CONFIG_LV_USE_SJPG is not set
-# CONFIG_LV_USE_GIF is not set
-# CONFIG_LV_USE_QRCODE is not set
-# CONFIG_LV_USE_FREETYPE is not set
-# CONFIG_LV_USE_RLOTTIE is not set
-# CONFIG_LV_USE_FFMPEG is not set
-# end of 3rd Party Libraries
-
-#
-# Others
-#
-CONFIG_LV_USE_SNAPSHOT=y
-# CONFIG_LV_USE_MONKEY is not set
-# CONFIG_LV_USE_GRIDNAV is not set
-# CONFIG_LV_USE_FRAGMENT is not set
-# CONFIG_LV_USE_IMGFONT is not set
-# CONFIG_LV_USE_MSG is not set
-# CONFIG_LV_USE_IME_PINYIN is not set
-# end of Others
-
-#
-# Examples
-#
-CONFIG_LV_BUILD_EXAMPLES=y
-# end of Examples
-# end of LVGL configuration
-
#
# GPS
#
#
# Camera Configurations
#
-CONFIG_CAMERA_SUPPORT=y
-CONFIG_CSI_SUPPORT=y
-CONFIG_GX316_CSI=y
-CONFIG_CAMERA_SENSOR_SUPPORT=y
-CONFIG_CAMERA_SENSOR_GC032A=y
-CONFIG_CAMERA_SENSOR_BF20A6=y
-# CONFIG_CAMERA_SENSOR_BF30A2 is not set
-# CONFIG_CAMERA_SENSOR_BF3901UCS is not set
-# CONFIG_CAMERA_SENSOR_GC6133 is not set
-# CONFIG_CAMERA_VIDEO_SUPPORT is not set
-CONFIG_CAMERA_AT_CMD_SUPPORT=y
-# CONFIG_CAMERA_OPEN_BY_DEFAULT is not set
-# CONFIG_JPEG_SUPPORT is not set
+# CONFIG_CAMERA_SUPPORT is not set
# end of Camera Configurations
CONFIG_APP=y
# APP Component & Utility
#
# CONFIG_COMP_MSGBOX is not set
-# CONFIG_USE_ALV_BTNMATRIX is not set
-# CONFIG_USE_ALV_MENU is not set
# end of APP Component & Utility
#
# CONFIG_I2C_SAMPLE is not set
# CONFIG_UART_SAMPLE is not set
# CONFIG_POWER_SUPPLY_SAMPLE is not set
-# CONFIG_BACKLIGHT_SAMPLE is not set
# CONFIG_SMS_SAMPLE is not set
# CONFIG_RADIO_CFUN_SAMPLE is not set
# CONFIG_WIFISCAN_SAMPLE is not set
#include <stdio.h>
#include <aic_cmdline.h>
-#define AIC_RELEASE_NUM "00007"
-#define AIC_BUILD_NUMBER "J44"
+#define AIC_RELEASE_NUM "00008"
+#define AIC_BUILD_NUMBER "J48"
struct aic_version s_version = {
.version = AIC_SW_VERSION,
#
# AIChat Config
#
-CONFIG_AICHAT_SUPPORT=y
-# CONFIG_AICHAT_AT_CMD_SUPPORT is not set
-CONFIG_AICHAT_KEY_BOARD_SUPPORT=y
-CONFIG_AICHAT_ASR_SUPPORT=y
-CONFIG_ASR_ALI_SUPPORT=y
-# CONFIG_ASR_ARK_SUPPORT is not set
-CONFIG_AICHAT_LLM_SUPPORT=y
-CONFIG_LLM_ALI_SUPPORT=y
-CONFIG_LLM_ARK_SUPPORT=y
-CONFIG_LLM_KIMI_SUPPORT=y
-CONFIG_LLM_JIUTIAN_SUPPORT=y
-CONFIG_LLM_HUNYUAN_SUPPORT=y
-CONFIG_AICHAT_TTS_SUPPORT=y
-CONFIG_TTS_ALI_SUPPORT=y
-# CONFIG_TTS_ARK_SUPPORT is not set
-# CONFIG_HISTORY_CHAT_SUPPORT is not set
-# CONFIG_CHUANGWEI_AI_SUPPORT is not set
-# CONFIG_CMIOT_BOARD_SUPPORT is not set
+# CONFIG_AICHAT_SUPPORT is not set
# end of AIChat Config
#
# CONFIG_APP_ALARM is not set
# CONFIG_APP_NOTIFY_CENTER is not set
# CONFIG_APP_USB is not set
+CONFIG_APP_AI_AMP_2_5=y
# end of Enable APPs
#
# end of Telephony sample
# end of Sample codes
-# CONFIG_VENDORS is not set
+CONFIG_VENDORS=y
+# CONFIG_SSV_WIFI is not set
+# CONFIG_FOTA_SUPPORT_ABUP is not set
+CONFIG_TTS_IFLY=y
+# CONFIG_TC_IOT_VIDEO is not set
#include <aic_io.h>
#include <aic_cmd_api.h>
#include <flash_mem_config.h>
+#include <fmd.h>
#include "ivTTS.h"
#define IVTTS_IRF_IN_FILE 0
-#if IVTTS_IRF_IN_FILE
-#define IVTTS_IRF_ADDR (void *)fs_open("/O/ivTTS.irf", FS_O_RDONLY);
-#else
-#define IVTTS_IRF_ADDR (void *)FLASH1_IVTTS_IRF_BASE;
-#endif
+#define IVTTS_IRF_FMD_NAME "ivTTS_irf"
+#define IVTTS_IRF_ADDR (void *)fs_open("/O/ivTTS.irf", FS_O_RDONLY);
/* constant for TTS heap size */
#define IVTTS_HEAP_SIZE (1024 * 60)
ivResAddress iPos, /* [in] read start position */
ivResSize nSize ) /* [in] read size */
{
- char *pirf;
-
- pirf = (char *)pParameter + iPos;
- memcpy(pBuffer, pirf, nSize);
-
- return ivTrue;
+ return !fmd_read((u32)pParameter, iPos, nSize, pBuffer);
}
#endif
}
memset(ivtts->heap, 0, IVTTS_HEAP_SIZE);
-
+#if IVTTS_IRF_IN_FILE
tResPackDesc.pCBParam = IVTTS_IRF_ADDR;
+#else
+ if (fmd_open(IVTTS_IRF_FMD_NAME, (u32 *)(&tResPackDesc.pCBParam))) {
+ aicx_error(0x065a9f, "", "can not open ivtts partition!\n");
+ goto err_no_irf;
+ }
+#endif
aicx_info(0x1bff4f, "x", "irf handle=0x%x\n", tResPackDesc.pCBParam);
tResPackDesc.pfnRead = ReadResCB;
pmic_writel(0x54, pmic_readl(0x54) & ~BIT(12));
pmic_writel(0x58, pmic_readl(0x58) & ~BIT(12));
+ /* switch to hw cali logic */
+ val = pmic_readl(0x23c);
+ val |= 0x4;
+ pmic_writel(0x23c, val);
+
val = pmic_readl(0x238);
val &= ~BIT(17);
pmic_writel(0x238, val);
log_print("rc32k int status 0x%x", pmic_readl(0x244));
tmp = pmic_readl(0x244);
tmp |= 0x4;
- pmic_writel(0x244, val);
+ pmic_writel(0x244, tmp);
tmp &= ~0x4;
- pmic_writel(0x244, val);
+ pmic_writel(0x244, tmp);
ret = -1;
break;
}
- if (val < delta) {
+ if (val2 & BIT(1)) {
log_print("rc32k calibration success!\n");
ret = 0;
break;
val |= BIT(16);
/* configure cali interval to 1min */
val &= ~0x3fff;
- val |= 0x3c;
+ val |= 0x258;
pmic_writel(0x238, val);
+
/* disable hw cali in normal and deep */
val = pmic_readl(0x248);
val &= ~3;
pmic_writel(0x248, val);
- /* switch to hw cali logic */
- val = pmic_readl(0x23c);
- val |= 0x4;
- pmic_writel(0x23c, val);
-
/* enable calibrantion clock */
val = pmic_readl(0x168);
val |= 0x1;
/* 2.6ms hw cali */
val = pmic_readl(0x230);
- val = 0x050803ff;
+ val = 0x050083ff;
pmic_writel(0x230, val);
val = pmic_readl(0x24c);
val &= ~0x3;
aic_gp202_rc32k_sw_cali_trigger();
ret = aic_gp202_rc32k_sw_cali_check(128);
- /* modify cali time 1344 cycles, 88ms */
+ /* modify cali time 82ms */
val = pmic_readl(0x24c);
+ val &= ~3;
val |= 0x3;
pmic_writel(0x24c, val);
# Folders needed for conf/mconf files (kconfig has no method of redirecting all output files).
# conf/mconf needs to be run from a different directory because of: GH-3408
-message(STATUS "### ${CMAKE_BINARY_DIR}")
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/auto_generate/kconfig/include/generated)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/auto_generate/kconfig/include/config)
# - For Python 3, force the encoding. Forcing the encoding on Python 2
# turns strings into Unicode strings, which gets messy. Python 2
# doesn't decode regular strings anyway.
- print("@@@ open %s %s" %(filename, mode))
return open(filename, "rU" if mode == "r" else mode) if _IS_PY2 else \
open(filename, mode, encoding=self._encoding)
aicos/components/Kconfig
aicos/components/aic_ctrl
aicos/components/aichat/Kconfig
+aicos/components/aichat/aichat_ui_events.h
aicos/components/aichat/aichat_agent/aichat_agent_mnger.h
aicos/components/aichat/aichat_agent/aichat_agent.h
aicos/components/aichat/aichat_adapter/client.h
"description": "sys"
},
"base": {
- "value": "gx306l_h3-v25.007",
+ "value": "gx306l_h3-v25.008",
"len": 48,
"type": "string",
"description": "base version"
"description": "sys"
},
"base": {
- "value": "gx306l_h3-v25.007",
+ "value": "gx306l_h3-v25.008",
"len": 48,
"type": "string",
"description": "base version"
"attribute": "RO"
},
"ap": {
- "block_num": 375,
+ "block_num": 215,
"attribute": "RO"
},
"fota_bak": {
"block_num": 1,
"attribute": "RW"
},
+ "ivTTS_irf": {
+ "block_num": 160,
+ "attribute": "RW"
+ },
"ptable": {
"block_num": 1,
"attribute": "RW"
"flash_type": "qspi_nor",
"description": "factory backup station partition"
},
+ "ivTTS_irf": {
+ "flag": 1,
+ "select": 1,
+ "bin_path": "ap/bin/ivTTS_irf.bin",
+ "flash_type": "qspi_nor",
+ "description": "ivTTS irf partition"
+ },
"ptable": {
"flash_type": "qspi_nor",
"description": "partition table"