-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move IPC definitions into ipc_defines.h, fix linter errors, revert gr…
…id draw
- Loading branch information
1 parent
c5be3fc
commit 85c4dab
Showing
16 changed files
with
202 additions
and
165 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/****************************************************************************** | ||
* | ||
* Copyright (C) 2024 Analog Devices, Inc. | ||
* | ||
* 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 EXAMPLES_MAX32655_DEMO_2048_ARM_INC_IPC_DEFINES_H_ | ||
#define EXAMPLES_MAX32655_DEMO_2048_ARM_INC_IPC_DEFINES_H_ | ||
|
||
/* **** Includes **** */ | ||
|
||
#include <stdint.h> | ||
|
||
/* **** Definitions **** */ | ||
|
||
// These should match with the RISC-V core's copy of ipc_defines.h | ||
|
||
/// Semaphores | ||
// Should never reach here | ||
#if (MAILBOX_SIZE == 0) | ||
#error "Mailbox size is 0." | ||
#endif | ||
|
||
// Keep track for Semaphore peripheral. | ||
#define SEMA_IDX_ARM (0) | ||
#define SEMA_IDX_RISCV (1) | ||
|
||
#define MAILBOX_OVERHEAD (2 * sizeof(uint16_t)) | ||
#define MAILBOX_PAYLOAD_LEN (MAILBOX_SIZE - MAILBOX_OVERHEAD) | ||
typedef struct { | ||
uint16_t readLocation; | ||
uint16_t writeLocation; | ||
#if (MAILBOX_SIZE == 0) | ||
uint8_t payload[1]; | ||
#else | ||
uint8_t payload[MAILBOX_PAYLOAD_LEN]; | ||
#endif | ||
} mxcSemaBox_t; | ||
|
||
#define MAILBOX_MAIN_GRID_IDX (0) // Main grid indexes are from 0 to (16 blocks * 4 bytes) - 1. | ||
#define MAILBOX_MAIN_GRID_STATE_IDX (4 * 16) // Indexes are from (4 bytes * 16) to ((4 bytes * 16) + (1 byte * 16))) | ||
#define MAILBOX_KEYPRESS_IDX ((4 * 16) + (1 * 16)) // All indexes before are for the main grids. | ||
#define MAILBOX_IF_BLOCK_MOVED_IDX (MAILBOX_KEYPRESS_IDX + 1) | ||
#define MAILBOX_NEW_BLOCK_LOCATION_IDX (MAILBOX_IF_BLOCK_MOVED_IDX + 1) | ||
#define MAILBOX_GAME_STATE_IDX (MAILBOX_NEW_BLOCK_LOCATION_IDX + 1) | ||
#define MAILBOX_MOVES_COUNT_IDX (MAILBOX_GAME_STATE_IDX + 1) | ||
|
||
#endif // EXAMPLES_MAX32655_DEMO_2048_ARM_INC_IPC_DEFINES_H_ |
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
Oops, something went wrong.