-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix typos, lower baudrate to 115200, move mailbox/semaphore definitio…
…ns outside of RISCV to hide intellisense not finding definition error (build/buildrv/project_defines.h)
- Loading branch information
1 parent
55b2f18
commit c5be3fc
Showing
4 changed files
with
63 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/****************************************************************************** | ||
* | ||
* 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. | ||
* | ||
******************************************************************************/ | ||
|
||
/* **** Includes **** */ | ||
|
||
/* **** Definitions **** */ | ||
|
||
/// 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) | ||
|
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