This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] MSP430FR2355:是否可以将数组传递到将数据加载到通用数组的函数中?

Guru**** 2538950 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1000948/msp430fr2355-is-it-possible-to-pass-an-array-into-a-function-where-the-data-is-loaded-into-a-generic-array

器件型号:MSP430FR2355

大家好、

我们希望您在以下客户咨询方面提供帮助。

现在、我正在尝试了解当我要存储配置数据并将其加载到 i2c 器件时、代码应该是什么样子的。
我想我会将数据存储在一维或二维数组中。 也许有一种不同的方法。
那么、新的问题是使用一个 TX 函数使代码保持简单、是否可以将数组传递到一个函数、在该函数中、数据被加载到通用数组中?
例如

TX 函数(SlaveDevX[])

通用[]=从设备 X[]


MAIN ()

SlaveDev1[]={0x05、0x06、0x07、0x08、0x10 0x11}
SlaveDev2[]={0x05、0x06、0x07}
SlaveDev3[]={0x01、0x02}
TX 函数(SlaveDev1[])


中断 ISR

输出缓冲器=通用[];


我是否已完全关闭?

此致、

Danilo

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Danilo、

    我想您 可以尝试  memcpy 函数。

    谢谢!

    此致

    Johnson