Suchergebnisse für "sizeof"
packet_t bufferData[PACKET_BUFFER_SIZE]; static CircularBuffer<NRF24_packet_t> packetBuffer(bufferData, sizeof (bufferData) / sizeof (bufferData[0])); static Serial_header_t SerialHdr; static uint16_t lastCRC; static uint16_t crc; uint8_t channels[] = {3, 23, 40, 61, 75}; //{1, 3, 6, 9, 11, 23, 40, 61, 75} uint8
in
„Wechselrichter Hoymiles HM-xxxx 2,4 GhZ Nordic Protokoll?“
·
Mikrocontroller und Digitale Elektronik
·
31.08.2022 21:49
Thread
int len) { static const char *TAG = "onDataRecv"; memcpy(&message_s, incomingData, sizeof (message_s)); ESP_LOGI(TAG, "Packet received from: %02X:%02X:%02X:%02X:%02X:%02X", mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]); ESP_LOGI(TAG, "\tid: 0x%02X
Mikrocontroller und Digitale Elektronik
· Vincent
· 20.08.2022 10:27
· 4 Antworten
packet_t bufferData[PACKET_BUFFER_SIZE]; static CircularBuffer<NRF24_packet_t> packetBuffer(bufferData, sizeof (bufferData) / sizeof (bufferData[0])); static Serial_header_t SerialHdr; static uint16_t lastCRC; static uint16_t crc; uint8_t channels[] = {3, 23, 40, 61, 75}; //{1, 3, 6, 9, 11, 23, 40, 61, 75} uint8
in
„Wechselrichter Hoymiles HM-xxxx 2,4 GhZ Nordic Protokoll?“
·
Mikrocontroller und Digitale Elektronik
·
15.08.2022 21:17
packet_t bufferData[PACKET_BUFFER_SIZE]; static CircularBuffer<NRF24_packet_t> packetBuffer(bufferData, sizeof (bufferData) / sizeof (bufferData[0])); static Serial_header_t SerialHdr; static uint16_t lastCRC; static uint16_t crc; uint8_t channels[] = {3, 23, 40, 61, 75}; //{1, 3, 6, 9, 11, 23, 40, 61, 75} uint8
in
„Wechselrichter Hoymiles HM-xxxx 2,4 GhZ Nordic Protokoll?“
·
Mikrocontroller und Digitale Elektronik
·
15.08.2022 19:00
packet_t bufferData[PACKET_BUFFER_SIZE]; static CircularBuffer<NRF24_packet_t> packetBuffer(bufferData, sizeof (bufferData) / sizeof (bufferData[0])); static Serial_header_t SerialHdr; static uint16_t lastCRC; static uint16_t crc; uint8_t channels[] = {3, 23, 40, 61, 75}; //{1, 3, 6, 9, 11, 23, 40, 61, 75} uint8
in
„Wechselrichter Hoymiles HM-xxxx 2,4 GhZ Nordic Protokoll?“
·
Mikrocontroller und Digitale Elektronik
·
14.08.2022 11:01
packet_t bufferData[PACKET_BUFFER_SIZE]; static CircularBuffer<NRF24_packet_t> packetBuffer(bufferData, sizeof (bufferData) / sizeof (bufferData[0])); static Serial_header_t SerialHdr; static uint16_t lastCRC; static uint16_t crc; uint8_t channels[] = {3, 23, 40, 61, 75}; //{1, 3, 6, 9, 11, 23, 40, 61, 75} uint8
in
„Wechselrichter Hoymiles HM-xxxx 2,4 GhZ Nordic Protokoll?“
·
Mikrocontroller und Digitale Elektronik
·
13.08.2022 15:36
packet_t bufferData[PACKET_BUFFER_SIZE]; static CircularBuffer<NRF24_packet_t> packetBuffer(bufferData, sizeof (bufferData) / sizeof (bufferData[0])); static Serial_header_t SerialHdr; static uint16_t lastCRC; static uint16_t crc; uint8_t channels[] = {3, 23, 40, 61, 75}; //{1, 3, 6, 9, 11, 23, 40, 61, 75} uint8
in
„Wechselrichter Hoymiles HM-xxxx 2,4 GhZ Nordic Protokoll?“
·
Mikrocontroller und Digitale Elektronik
·
11.08.2022 19:57
packet_t bufferData[PACKET_BUFFER_SIZE]; static CircularBuffer<NRF24_packet_t> packetBuffer(bufferData, sizeof (bufferData) / sizeof (bufferData[0])); static Serial_header_t SerialHdr; static uint16_t lastCRC; static uint16_t crc; uint8_t channels[] = {3, 23, 40, 61, 75}; //{1, 3, 6, 9, 11, 23, 40, 61, 75} uint8
in
„Wechselrichter Hoymiles HM-xxxx 2,4 GhZ Nordic Protokoll?“
·
Mikrocontroller und Digitale Elektronik
·
11.08.2022 19:44
packet_t bufferData[PACKET_BUFFER_SIZE]; static CircularBuffer<NRF24_packet_t> packetBuffer(bufferData, sizeof (bufferData) / sizeof (bufferData[0])); static Serial_header_t SerialHdr; static uint16_t lastCRC; static uint16_t crc; uint8_t channels[] = {3, 23, 40, 61, 75}; //{1, 3, 6, 9, 11, 23, 40, 61, 75} uint8
in
„Wechselrichter Hoymiles HM-xxxx 2,4 GhZ Nordic Protokoll?“
·
Mikrocontroller und Digitale Elektronik
·
11.08.2022 18:36
Thread
", pres); state = ANIMATION; break; case ANIMATION: strftime(str_temp, sizeof (str_temp), "DATE:%d.%m.%Y %H:%M", &timeinfo); state = DATE; break; default: break; } Serial.print(F("State = ")); //print state
", pres); state = ANIMATION; break; case ANIMATION: strftime(str_temp, sizeof (str_temp), "DATE:%d.%m.%Y %H:%M", &timeinfo); state = DATE; break; default: break; } Serial.print(F("State = ")); //print state
Mikrocontroller und Digitale Elektronik
· Wukasch D.
· 13.08.2022 17:23
· 9 Antworten
Thread
smbusStackHandle.CMD_table = (st_command_t *) &CHIP_DATA[0]; smbusStackHandle.CMD_tableSize = sizeof (CHIP_DATA)/sizeof (CHIP_DATA[0]); smbusStackHandle.StateMachine = SMBUS_SMS_NONE; smbusStackHandle.Device = &BSP_BATTERY_I2C; smbusStackHandle.SRByte = 0x55U; smbusStackHandle.CurrentCommand
Mikrocontroller und Digitale Elektronik
· David R.
· 11.08.2022 08:08
· 0 Antworten
Thread
value pointed to by ptr. The requested alignment must be a power of 2 at least as large as sizeof (void *). [/pre] Das Backend für malloc muss man in der newlib eh selbst implementieren (sbrk). Warum sie aber dann für posix_memalign keine Implementierung haben, ist verwunderlich. Müsstest
Mikrocontroller und Digitale Elektronik
· J. S.
· 13.11.2022 17:45
· 21 Antworten
header.h" const element_t element[] = { {1,2}, {3,4}, {5,6} }; const config_t config = { element, sizeof (element) / sizeof (element_t) };
in
„Größe eines externen Arrays in C“
·
Softwareentwicklung
·
08.08.2022 22:00
Thread
element_t; extern const element_t element[100]; // Test int main() { printf("%d\n", sizeof (element)/sizeof (element_t)); } [/c] Gruss, Udo
include "header.h" > const element_t element[] = { {1,2}, {3,4}, {5,6} }; > size_t nElemente = sizeof (element)/sizeof (element[0]);
Softwareentwicklung
· Tim T.
· 11.08.2022 19:42
· 67 Antworten
packet_t bufferData[PACKET_BUFFER_SIZE]; static CircularBuffer<NRF24_packet_t> packetBuffer(bufferData, sizeof (bufferData) / sizeof (bufferData[0])); static Serial_header_t SerialHdr; static uint16_t lastCRC; static uint16_t crc; uint8_t channels[] = {3,23, 40, 61, 75}; //{1, 3, 6, 9, 11, 23, 40, 61, 75} uint8
in
„Wechselrichter Hoymiles HM-xxxx 2,4 GhZ Nordic Protokoll?“
·
Mikrocontroller und Digitale Elektronik
·
08.08.2022 08:53
Thread
r\n"),1000);[/c]. Das "OK" Signal empfange ich mit [c]HAL_UART_Receive(&huart1,(uint8_t *)Reply,sizeof (Reply),1000);[/c] und gebe es am Terminal aus mit [c]HAL_UART_Transmit(&huart2,(uint8_t *)Reply,sizeof (Reply),1000);[/c]. Vielen Dank für die Hilfe! Grüße Sam_oe1
bitte nicht mit sizeof -1 Konstrukten anfangen.
Mikrocontroller und Digitale Elektronik
· Sam_Oe1
· 10.08.2022 23:46
· 17 Antworten
LATDbits.LATD1 = HIGH; //initializations i2c_drv_init(); i2c_hal_type test_i2c_hal; uint8_t cmd_buffer[100 * sizeof (int)]; uint8_t write_buffer[500]; uint8_t read_buffer[500]; i2c_hal_init(&test_i2c_hal, cmd_buffer, sizeof (cmd_buffer), write_buffer, sizeof (write_buffer), read_buffer, sizeof (read_buffer)); i2c_hal_cb_start_set
in
„PIC32MZ2048EFG100 Probleme bei I2C read“
·
Mikrocontroller und Digitale Elektronik
·
02.08.2022 14:40
mSerialValues = true; + mSDValues = false; mSerialDebug = false; memset(mPayload, 0, (MAX_NUM_INVERTERS * sizeof (invPayload_t))); @@ -122,6 +128,12 @@ void app::setup(uint32_t timeout) { mSerialDebug = (tmp == 0x01); mSys->Radio.mSerialDebug = mSerialDebug; + // SD logging + mEep->read(ADDR_LOG_INTERVAL, &mSDlogInterval
in
„Wechselrichter Hoymiles HM-xxxx 2,4 GhZ Nordic Protokoll?“
·
Mikrocontroller und Digitale Elektronik
·
01.08.2022 17:33
mSerialValues = true; + mSDValues = false; mSerialDebug = false; memset(mPayload, 0, (MAX_NUM_INVERTERS * sizeof (invPayload_t))); @@ -122,6 +128,12 @@ void app::setup(uint32_t timeout) { mSerialDebug = (tmp == 0x01); mSys->Radio.mSerialDebug = mSerialDebug; + // SD logging + mEep->read(ADDR_LOG_INTERVAL, &mSDlogInterval
in
„Wechselrichter Hoymiles HM-xxxx 2,4 GhZ Nordic Protokoll?“
·
Mikrocontroller und Digitale Elektronik
·
31.07.2022 19:52
inline register restrict return char const double float int long short signed static union unsigned sizeof struct switch void volatile while C_InstFCol: Vordergrundfarbe der Schlüsselwörter C_InstBCol: Hintergrundfarbe der Schlüsselwörter z.B: F=rgb(0, 0, 255), B=rgb(255, 255, 255) C_Register: Liste der
in
„UART auf Linux“
·
Mikrocontroller und Digitale Elektronik
·
27.07.2022 19:05
Thread
16:09;A;B;12 23 34 45 55 66 77;0.0 %"; int main() { char buf[100]; memset(buf, 0, sizeof (buf)); memcpy(buf, strbuf + 26, 20); printf("[%s]\n", buf); return 0; } [/c]
Softwareentwicklung
· Mo
· 21.07.2022 22:13
· 19 Antworten
Thread
meineVariable = { 0, 0, 0 }; blafusel meineAndereVariable; memset(&meineAndereVariable, 0, sizeof (meineAndereVariable)); [/c]
Softwareentwicklung
· Zorro
· 19.07.2022 14:02
· 92 Antworten
RealAlarmDataNO); AlarmTwoPack = 0; RealAlarmDataNO = 0; memset((AlarmDataType *)pRealAlarm, 0, sizeof (AlarmDataType) * 20); break; } RealAlarmDataNO = 0; memset((AlarmDataType *)pRealAlarm, 0, sizeof (AlarmDataType) * 20); } } //Not finished training if(DataAarnNub > WarnSerNub[PortNO]) { CurAlarmState
in
„Wechselrichter Hoymiles HM-xxxx 2,4 GhZ Nordic Protokoll?“
·
Mikrocontroller und Digitale Elektronik
·
15.07.2022 00:35
Data.Power, 0, 2 * sizeof (u8)); memset((u8 *)MIReal[i].Data.Temper, 0, 2 * sizeof (u8)); memset((u8 *)MIReal[i].Data.Run_Status, 0, 2 * sizeof (u8)); memset((u8 *)MIReal[i].Data.Fault_Code, 0, 2 * sizeof (u8)); memset((u8 *)MIReal
in
„Wechselrichter Hoymiles HM-xxxx 2,4 GhZ Nordic Protokoll?“
·
Mikrocontroller und Digitale Elektronik
·
15.07.2022 00:34
Thread
Hi, leider so nicht. Du müsstest schon z.B. st_Data data1 = {0, sizeof (data), data}; initialisieren, um eine Längeninfo zu haben. Grüsse
seine Länge: [c] #include <stdio.h> int main() { char c[500]; printf("%zu\n", sizeof c); return 0; } [/c] Die Array-Länge ist allerdings nicht Teil des einzelnen Arrays, sondern seines Typs. Die Probleme fangen dann bei Zeigern an, weil ein: toto schrieb im Beitrag #7123127
Softwareentwicklung
· toto
· 12.07.2022 09:57
· 7 Antworten
timeinfo.tm_mday, month_M[timeinfo.tm_mon], (timeinfo.tm_year) + 1900); } strftime(update_time, sizeof (update_time), "%H:%M:%S", &timeinfo); // Creates: '14:05:49' sprintf(time_output, "%s %s", TXT_UPDATED, update_time); } else { strftime(day_output, sizeof (day_output), "%a %b-%d-%Y", &timeinfo); // Creates 'Sat May-31-2019' strftime(update_time, sizeof (update_time), "%r", &timeinfo); // Creates: '02:05:49pm' sprintf(time_output, "%s %s", TXT_UPDATED, update_time); } Date_str = day_output; Time_str = time_output; return true; } //#################
in
„ESP8266 mit Waveshare 7,5" E-Paper - funktioniert nicht“
·
Mikrocontroller und Digitale Elektronik
·
10.07.2022 23:29
Thread
uint16_t memaddr, T &obj) writes an object to memaddr (and following bytes). Returns memaddr + sizeof (obj) to get the next address to write to.“
Mikrocontroller und Digitale Elektronik
· hawky
· 08.07.2022 18:48
· 4 Antworten
Thread
[c] uint8_t telegram_data[] = {1, 2, 3}; uint16_t length = sizeof (telegram_data); st_telegramData testtelegramm = { length, &telegram_data[0] }; st_telegramData testtelegramm1 = { length, telegram_data }; // gleichwertig wie &x[0] [/c]
Softwareentwicklung
· tester
· 08.07.2022 15:43
· 11 Antworten
Thread
} if(current_command == NULL) { parent->children = (struct scpi_command*)malloc(sizeof (struct scpi_command)); current_command = parent->children; } else { while(current_command->next != NULL) { current_command = current_command->next; } current_command->next = (struct scpi_command*)malloc(sizeof (struct scpi_command)); current_command = current_command->next; } current_command->next = NULL; current_command->children = NULL; current_command->long_name = long_name;
Mikrocontroller und Digitale Elektronik
· Tim T.
· 18.07.2022 12:53
· 20 Antworten
scpi_command* system; struct scpi_command* error; ctx->command_tree = (struct scpi_command*)malloc(sizeof (struct scpi_command)); ctx->command_tree->long_name = NULL; ctx->command_tree->long_name_length = 0; ctx->command_tree->short_name = NULL; ctx->command_tree->short_name_length = 0; ctx->command_tree
in
„32 Relais über einen Arduino mit SCPI“
·
Mikrocontroller und Digitale Elektronik
·
07.07.2022 17:13
#include <AVRxDB_Pin.h> const uint32_t i2cFreq [] = {100000, 400000}; const uint8_t ANZAHLFREQ = sizeof (i2cFreq) / sizeof (i2cFreq[0]); OutputPin <pinPB4> userLed0; void setup() { Serial2.swap(1); // PF4 TXD2 / PF5 RXD2 Serial2.begin(250000); Serial2.println("\nuC Reset #### ####"); userLed0.init(); Wire.begin
in
„NXP PCA8574 hat Phänomen mit 2 Adressen“
·
Mikrocontroller und Digitale Elektronik
·
05.07.2022 22:42
Thread
. Sie sind genauso leer, nur sind sie eben nicht Teil des Typs. Das erkennt man z.B. auch per sizeof . So ist sizeof (__float80) nicht 10, sondern 16.
Da wird man doch sowieso durch ein Array oder String iteririeren. Und sowohl strlen() als auch sizeof geben "size_t" zurück.
Mikrocontroller und Digitale Elektronik
· Franz
· 16.07.2022 17:38
· 168 Antworten
Thread
int i = 0; char* token; // allocate string memory char ** temp = malloc(10 * sizeof (char*)); for (int i =0 ; i < 10; ++i) { temp[i] = malloc(20 * sizeof (char)); temp[i][0] = 0; } /* have a look first */ token = strtok(StringToSplit, delimiters
Softwareentwicklung
· Bartosz B.
· 04.07.2022 21:04
· 11 Antworten
Thread
char ist dort dann schlicht größer als nur 8 Bit, obwohl per definitionem in C immer noch gilt: sizeof (char) = 1.) Auf solchen Architekturen gibt es natürlich dann trotzdem noch uint_least8_t und uint_fast8_t. Aber die sind bei W.S. eh noch nicht vorbei gekommen.
Mikrocontroller und Digitale Elektronik
· Christian S.
· 05.07.2022 15:10
· 19 Antworten
Thread
a string char macStr[18]; Serial.print("Packet received from: "); snprintf(macStr, sizeof (macStr), "%02x:%02x:%02x:%02x:%02x:%02x", mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]); Serial.println(macStr); memcpy(&incomingReadings, incomingData, sizeof (incomingReadings)); board["id"] = incomingReadings.id; board["temperature"] = incomingReadings.temp; board["humidity"] = incomingReadings.hum; board["temp1"] = incomingReadings.temp1
Mikrocontroller und Digitale Elektronik
· Daniel K.
· 30.06.2022 18:32
· 18 Antworten
mac address to a string char macStr[18]; Serial.print("Packet received from: "); snprintf(macStr, sizeof (macStr), "%02x:%02x:%02x:%02x:%02x:%02x", mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]); Serial.println(macStr); memcpy(&incomingReadings, incomingData, sizeof (incomingReadings
in
„ESP 8266 ESP-NOW Webserver“
·
Mikrocontroller und Digitale Elektronik
·
30.06.2022 09:54
Thread
0x02, 0x00, 0x6A, 0xE4, 0x79}; uint16_t crc = 0xFFFF; updateCCITTCrc(crc, testvect, sizeof (testvect)); cout << hex << crc << endl; //-> 0x3088 return 0; } [/code] Da kommt 0x3088 als Ergebnis raus. Dann mal diesen Testvektor z. B. hier einhacken: http://www.sunshine2k.de
Softwareentwicklung
· Werner
· 29.06.2022 08:08
· 4 Antworten
PIE13bits.U5TXIE) { U5TXB = txData; } else { PIE13bits.U5TXIE = 0; uart5TxBuffer[uart5TxHead++] = txData; if(sizeof (uart5TxBuffer) <= uart5TxHead) { uart5TxHead = 0; } uart5TxBufferRemaining--; } PIE13bits.U5TXIE = 1; } void UART5_Transmit_ISR(void) { // use this default transmit interrupt handler code if(sizeof (uart5TxBuffer) > uart5TxBufferRemaining) { U5TXB = uart5TxBuffer[uart5TxTail++]; if(sizeof (uart5TxBuffer) <= uart5TxTail) { uart5TxTail = 0; } uart5TxBufferRemaining++; } else { PIE13bits.U5TXIE = 0; } // or set custom function using UART5_SetTxInterruptHandler() } void UART5_Receive_ISR
in
„UART ich empfange nur 2 zeichen“
·
Mikrocontroller und Digitale Elektronik
·
28.06.2022 09:14
SYSTEM_Initialize(); tarvos_init(); INTERRUPT_GlobalInterruptEnable(); int a, i, j = 0; int length; length = sizeof (payload1) / sizeof (payload1[0]); while (1) { while (UART5_is_rx_ready()) { LATBbits.LATB3 = 1; __delay_ms(100); payload[i] = UART5_Read(); i++; LATBbits.LATB3 = 0; __delay_ms(100); } LATAbits.LATA0
in
„UART ich empfange nur 2 zeichen“
·
Mikrocontroller und Digitale Elektronik
·
28.06.2022 09:13
Thread
syslog_text, .ram_start = &stack, .bss_end = &bss_end, .shm_size = sizeof (shm_struct), .info_version = HDR_VERSION, .image_type = IT_PROGRAM, .dev_id = 0x464, .text_start = &image_hdr, .text_end = 0, .syslib_version
.ram_start = &stack, > .bss_end = &bss_end, > .shm_size = sizeof (shm_struct), > .info_version = HDR_VERSION, > .image_type = IT_PROGRAM, > .dev_id = 0x464, > .text_start = &image_hdr, > .text_end = 0,
Mikrocontroller und Digitale Elektronik
· Bauform B.
· 04.07.2022 17:41
· 65 Antworten
Thread
Treffend E. schrieb im Beitrag #7108424: > SerialWriteBuf(Anemometer_request, sizeof (Anemometer_request)); Ich frage mich: Wofür ist diese Funktion? Tut nicht ... [c] Serial1.write(Anemometer_request, sizeof (Anemometer_request)); [/c] ... genau das gleiche? Ok, ich kenne
leider nicht. Die Hardware fehlt mir. Ein Test Serial.print(Serial1.write(Anemometer_request,sizeof (Anemometer_request))); Würde dir auch beweisen, das genau dir richtige Anzahl Byte geschrieben werden.
Mikrocontroller und Digitale Elektronik
· Treffend E.
· 26.06.2022 22:54
· 67 Antworten
800 KHz. TWBR = 2; (?) const long allSpeed[] = { 50, 100, 200, 250, 400, 500, 800 }; long speed[sizeof (allSpeed) / sizeof (allSpeed[0])]; int speeds; int addressStart = 0; int addressEnd = 127; // DELAY BETWEEN TESTS #define RESTORE_LATENCY 5 // for delay between tests of found devices. bool delayFlag
in
„i2c & LCD stellt sich quer :/“
·
Mikrocontroller und Digitale Elektronik
·
23.06.2022 23:01
Thread
************************************************ char *pbuf = rxBuf; for (uint8_t i=0; i!=sizeof (val)*8; d? val>>=1:val<<=1, i++) { if (i && !(i%4)) *pbuf++ = '.'; *pbuf++ = (val & (d? 1:((typeof(val))1<<(sizeof (val)*8-1))))? '1':'0'; } *pbuf++ = '\n'; *pbuf = '\0'; Serial.print
>::value, "Can only print unsigned types"); char* pbuf = rxBuf; const std::size_t maxBuf = sizeof (rxBuf); // Maximale Anzahl ausgebbarer Bits (lasse 2 Bytes frei für Zeilenumbruch & 0-Byte) const std::size_t maxBits = std::min<std::size_t> (maxBuf - 2, sizeof (val)*CHAR_BIT); if (d) {
Projekte & Code
· Apollo M.
· 17.06.2022 22:12
· 29 Antworten
Thread
Hauptschleife so benutzen: [c] char buffer[200]; void loop() { if (appendUntil(Serial, buffer, sizeof (buffer), '\n')) { // If the line starts with "GET", do something if (strncmp(buffer,"GET ",4)==0) { ... } else {
Mikrocontroller und Digitale Elektronik
· Ansgar
· 11.06.2022 16:07
· 10 Antworten
Thread
dann geht's so: [pre](gdb) print swid $1 = "[ver:1.2.10]-[08:16:33 Jun 11 2022]" (gdb) print sizeof swid $2 = 36[/pre] im Gegensatz zu [pre](gdb) print sizeof SWID No symbol "SWID" in current context.[/pre] Damit es garnicht erst soweit kommt, benutze ich gerne [c]_Static_assert (sizeof (
{ uint8_t unused[E2END+1-(XXX+sizeof (SWID)-1)] oscCal[12], TimerOperation, TimeMode, ... swID[sizeof (SWID)-1]; } ee = {...}; [/c] Ideen/Vorschläge? sind willkommen!
Mikrocontroller und Digitale Elektronik
· Apollo M.
· 15.06.2022 09:05
· 19 Antworten
, 0, 2 * sizeof (uint8_t)); memset(MIReal[i].Data.Temper, 0, 2 * sizeof (uint8_t)); memset(MIReal[i].Data.Run_Status, 0, 2 * sizeof (uint8_t)); memset(MIReal[i].Data.Fault_Code, 0, 2 * sizeof (uint8_t)); memset(MIReal
in
„Wechselrichter Hoymiles HM-xxxx 2,4 GhZ Nordic Protokoll?“
·
Mikrocontroller und Digitale Elektronik
·
09.06.2022 21:57
Thread
} 14 15 16 unsigned foo2(unsigned ar[], unsigned index) 17 { 18 return ar[index * sizeof (TS)/sizeof (unsigned) + 3]; 19 } 20 [/c] [code] Ein alter 2008 cl macht draus: cl -O1 -c test.c dumpbin -disasm test.obj Note: Das erste Argument (ar) ist im Register ecx, edx
multipliziert index mit 16 (shl rax,4) und dividiert dann durch 4 (shr rax,2) Schreibe ich "ar[index * ( sizeof (TS)/sizeof (unsigned) ) + 3];" ist der Assembler Code von foo1 und foo2 identisch, da hier der Klammerausdruck als erstes ausgewertet wird und eine Konstante erkannt wird. [/code] Ein 2022 cl liefert
Softwareentwicklung
· Felix
· 09.06.2022 12:50
· 14 Antworten
konnte nicht geoeffnet werden!\n", argv[1]); exit(1); } while ( !feof(fp) ) { if( fread(buffer, sizeof (uint8_t), 2, fp) < 2 ) break; printf("0x%X\n", crc(buffer)); } fclose(fp); return 0; }
in
„CRC32 aus 16bit HEX-Daten“
·
Mikrocontroller und Digitale Elektronik
·
08.06.2022 13:05
Thread
mss_uart_instance_t *this_uart) { unsigned int rx_size = MSS_UART_get_rx(this_uart, g_rx_buff, sizeof (g_rx_buff) ); printf("\n------------------------- [UART RX HANDLER]"); uart_calls_cnt++; printf("\n-call cnt: %d", uart_calls_cnt); printf("\n * Size RX char: %d", rx_size); printf
scheint echt besser zu laufen :D [c] unsigned int rx_size = MSS_UART_get_rx(this_uart, g_rx_buff, sizeof (g_rx_buff)); (void)rx_size; uart_calls_cnt++; uart_handler_flag = 0; for (int i = 0; i < (int)rx_size; i++) { if (g_rx_buff[i] != '\n') { command[index_uart_read_out_cnt
Mikrocontroller und Digitale Elektronik
· Bergsfrau
· 10.06.2022 08:05
· 11 Antworten
Kombinationen in modulations(). int nmods = 3*nfreqs + 4*nfreqs*(nfreqs-1); *mods = (int*) malloc(nmods*sizeof (int)); memset( *mods, 0, nmods*sizeof (int)); return 0; } int modulations( const int *freqs, const int nfreqs, int **mods) { int cnt = 0; // f1 < f2 < ... < fn for( int i=0; i<nfreqs; ++i ) { // f1
in
„Einfache Berechnungssoftware für Funkmikrofone gesucht“
·
HF, Funk und Felder
·
30.05.2022 10:06