How to select c99 or c11 compiler in Beyond studio for NXP

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to select c99 or c11 compiler in Beyond studio for NXP

ソリューションへジャンプ
2,332件の閲覧回数
dmsherazi
Contributor IV

I am following the ZigbeeNodeControlBridge demo and I want to at least enable c99 support. Can any one please guide me how to enable c99 or c2011 support?

ラベル(1)
タグ(3)
1 解決策
2,114件の閲覧回数
davidashraf
Contributor V

Hello dostshah‌ 

Try to add this line in the Makefile under CFLAGS 

CFLAGS+= -std=c99

I haven't tried it with this code before so let me know if it worked for you 

Regards

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
2,115件の閲覧回数
davidashraf
Contributor V

Hello dostshah‌ 

Try to add this line in the Makefile under CFLAGS 

CFLAGS+= -std=c99

I haven't tried it with this code before so let me know if it worked for you 

Regards

0 件の賞賛
返信
2,114件の閲覧回数
dmsherazi
Contributor IV

This worked. Thanks a lot!

Below is a fragment of a Makefile with "CFLAGS+= -std=c99"  added for an example .

#
# Application target name

TARGET = ZigbeeNodeControlBridge
###############################################################################
#User definable make parameters that may be overwritten from the command line

JENNIC_SDK ?= JN-SW-4168
ZBPRO_DEVICE_TYPE = ZCR
JENNIC_MAC ?= MiniMacShim
PDM_BUILD_TYPE ?= _NONE
BAUD ?= 1000000
DEBUG ?= NONE
VERSION ?= 0

STACK_SIZE = 6500
MINIMUM_HEAP_SIZE = 2000

# Chip variant

JENNIC_CHIP ?= JN5168
JENNIC_CHIP_FAMILY ?= JN516x


###############################################################################
# Default DK2 development kit target hardware

JENNIC_PCB ?= DEVKIT2

###############################################################################
# Select the network stack (e.g. MAC, ZBPro)

JENNIC_STACK ?= ZLLHA
###############################################################################
# commands options
# enable optional commands as required per applicaion.
#
STACK_MEASURE      ?= 0
EXTENDED_DEBUG      ?= 0
ZCL_ON_HOST          ?= 0
DISCOVERY_ONLY_MODE ?= 0
#
###############################################################################
# Debug options - define DEBUG to enable
#DEBUG =HW
#
# Define which UART to use for HW debug
DEBUG_PORT ?= UART1

###############################################################################

CFLAGS  += -DUART_BAUD_RATE=$(BAUD)
CFLAGS  += -DVERSION=$(VERSION)
CFLAGS  += -std=c99
ifeq ($(DEBUG_PORT), UART1)
CFLAGS  += -DUART_DEBUGGING=1
CFLAGS  += -DDEBUG_UART=DBG_E_UART_1
#CFLAGS  += -DDEBUG_APP_OTA
CFLAGS  += -DDEBUG_ZCL
CFLAGS     += -DDEBUG_ZB_CONTROLBRIDGE_TASK
CFLAGS  += -DTRACE_APP
endif‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

After this for testing added the following line to code and build the project. If the build succeeds c99 support has been enabled! (which did!)

for (int yy = 0; yy < 2; yy++) {
// initialiation of a variable inside for loop is not available before c99
}
2,114件の閲覧回数
davidashraf
Contributor V

dostshah‌ 
Glad it helped .. Good luck :smileyhappy: 

0 件の賞賛
返信