This repository has been archived by the owner on Nov 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEATURE: leave out cell/short-range/gnss as required. (#754)
It is now possible for an application to leave out one or more of cell, short-range or GNSS from a build. This is done through the common ubxlib.mk and ubxlib.cmake files: simply change the make/CMake variable UBXLIB_FEATURES that you supply to that file from "cell short_range gnss" to "cell", or "short_range", or "gnss", or "cell gnss", or "cell short_range", whatever, and only the portions you specify will be included, saving flash and static RAM. If you have your own build system then make sure to bring in all of the "stub" files that this commit introduces, then you may remove .c files from whichever area, cell/short_range/gnss/ble/wifi, is unused and the ubxlib code should still compile/run but now with reduced footprint. Note about ESP-IDF linker: there is a bug/feature of the Espressif linker (discussed here: https://www.esp32.com/viewtopic.php?f=13&t=8418&p=35899), which is that if a .c file turns out to have no external linkage because all of the functions in that file happen to have WEAK counterparts, then the linker will entirely ignore the .c file and use the WEAK versions instead, which is not what you want at all. The workaround is to introduce a dummy function into such a .c file, one that has no WEAK counterpart, and make sure it is called from somewhere. You will see uXxxPrivateLink() (e.g. uGnssPosPrivateLink()) dummy functions spread throughout the files that contain functions that have WEAK stub versions, that function being called from the init function (e.g. uGnssInit()) so that there is definitely something in those .c files to keep the linker engaged.
- Loading branch information
Showing
79 changed files
with
2,946 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/* | ||
* Copyright 2019-2022 u-blox | ||
* | ||
* 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. | ||
*/ | ||
|
||
/** @file | ||
* @brief Stubs to allow the AT client to compile without short-range. | ||
*/ | ||
|
||
#ifdef U_CFG_OVERRIDE | ||
# include "u_cfg_override.h" // For a customer's configuration override | ||
#endif | ||
|
||
#include "stddef.h" // NULL, size_t etc. | ||
#include "stdint.h" // int32_t etc. | ||
#include "stdbool.h" | ||
|
||
#include "u_compiler.h" // U_WEAK | ||
#include "u_error_common.h" | ||
#include "u_short_range_pbuf.h" | ||
#include "u_short_range_module_type.h" | ||
#include "u_short_range.h" | ||
#include "u_short_range_edm_stream.h" | ||
|
||
/* ---------------------------------------------------------------- | ||
* PUBLIC FUNCTIONS | ||
* -------------------------------------------------------------- */ | ||
|
||
//lint -esym(593, pParam) Suppress pParam not being freed here | ||
U_WEAK int32_t uShortRangeEdmStreamAtCallbackSet(int32_t handle, | ||
uEdmAtEventCallback_t pFunction, | ||
void *pParam) | ||
{ | ||
(void) handle; | ||
(void) pFunction; | ||
(void) pParam; | ||
return (int32_t) U_ERROR_COMMON_NOT_SUPPORTED; | ||
} | ||
|
||
U_WEAK void uShortRangeEdmStreamAtCallbackRemove(int32_t handle) | ||
{ | ||
(void) handle; | ||
} | ||
|
||
U_WEAK void uShortRangeEdmStreamIpEventCallbackRemove(int32_t handle) | ||
{ | ||
(void) handle; | ||
} | ||
|
||
U_WEAK int32_t uShortRangeEdmStreamAtRead(int32_t handle, void *pBuffer, | ||
size_t sizeBytes) | ||
{ | ||
(void) handle; | ||
(void) pBuffer; | ||
(void) sizeBytes; | ||
return (int32_t) U_ERROR_COMMON_NOT_SUPPORTED; | ||
} | ||
|
||
U_WEAK int32_t uShortRangeEdmStreamAtEventSend(int32_t handle, uint32_t eventBitMap) | ||
{ | ||
(void) handle; | ||
(void) eventBitMap; | ||
return (int32_t) U_ERROR_COMMON_NOT_SUPPORTED; | ||
} | ||
|
||
U_WEAK bool uShortRangeEdmStreamAtEventIsCallback(int32_t handle) | ||
{ | ||
(void) handle; | ||
return false; | ||
} | ||
|
||
U_WEAK int32_t uShortRangeEdmStreamAtEventStackMinFree(int32_t handle) | ||
{ | ||
(void) handle; | ||
return (int32_t) U_ERROR_COMMON_NOT_SUPPORTED; | ||
} | ||
|
||
U_WEAK int32_t uShortRangeEdmStreamAtGetReceiveSize(int32_t handle) | ||
{ | ||
(void) handle; | ||
return (int32_t) U_ERROR_COMMON_NOT_SUPPORTED; | ||
} | ||
|
||
// End of file |
Oops, something went wrong.