Skip to content

Commit b38f5c3

Browse files
AlexTransittemoto
authored andcommitted
bug-fix multiplay intterupt
fix compile in AtmelStudio version 0203
1 parent c4acd0a commit b38f5c3

File tree

5 files changed

+88
-241
lines changed

5 files changed

+88
-241
lines changed

hardware/mega-firmware/config.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#define F_CPU 16000000UL // Clock Speed
55

6-
#define FIRMWARE_VERSION 0x0202
6+
#define FIRMWARE_VERSION 0x0203
77
#define MDB_TIMEOUT_MS 6
88
#define BUFFER_SIZE 50
99

hardware/mega-firmware/main.c

+10-6
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ int main(void) {
6969
clock_init();
7070
master_notify_init();
7171
led_init();
72-
buffer_init((buffer_t *const) & debugb);
73-
packet_clear_fast((packet_t *const) & request);
74-
packet_clear_fast((packet_t *const) & response);
72+
buffer_init((buffer_t * const) & debugb);
73+
packet_clear_fast((packet_t * const) & request);
74+
packet_clear_fast((packet_t * const) & response);
7575
mdb_init();
7676
wdt_reset();
7777
twi_init_slave(0x78);
@@ -106,7 +106,7 @@ int main(void) {
106106
if (!response_empty()) {
107107
response.filled = true;
108108
}
109-
packet_clear_fast((packet_t *const) & request);
109+
packet_clear_fast((packet_t * const) & request);
110110
}
111111
sei();
112112
nop();
@@ -187,7 +187,7 @@ static void cmd_reset(void) {
187187
static void cmd_debug(void) {
188188
response_begin(RESPONSE_OK);
189189
response_fn(FIELD_ERRORN, (void *)debugb.data, debugb.length);
190-
buffer_clear_fast((buffer_t *const) & debugb);
190+
buffer_clear_fast((buffer_t * const) & debugb);
191191
}
192192

193193
static void cmd_mdb_bus_reset(void) {
@@ -205,8 +205,12 @@ static void master_notify_init(void) {
205205
}
206206
static void master_notify_set(bool const on) {
207207
if (on) {
208-
bit_mask_set(MASTER_NOTIFY_PORT, _BV(MASTER_NOTIFY_PIN));
208+
if (TWCR == 0x45) { // FIXME magic number
209+
bit_mask_clear(TWCR, _BV(TWIE)); // FIXME move to main loop
210+
bit_mask_set(MASTER_NOTIFY_PORT, _BV(MASTER_NOTIFY_PIN));
211+
}
209212
} else {
213+
bit_mask_set(TWCR, _BV(TWIE)); // FIXME move to main loop
210214
bit_mask_clear(MASTER_NOTIFY_PORT, _BV(MASTER_NOTIFY_PIN));
211215
}
212216
}

hardware/mega-firmware/mega-firmware.atsln

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Global
1111
Release|AVR = Release|AVR
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR
15-
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR
14+
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Release|AVR
15+
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Release|AVR
1616
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR
1717
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR
1818
EndGlobalSection
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
3-
<ProjectComponents>
4-
<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
5-
<CApiVersion></CApiVersion>
6-
<CBundle></CBundle>
7-
<CClass>Device</CClass>
8-
<CGroup>Startup</CGroup>
9-
<CSub></CSub>
10-
<CVariant></CVariant>
11-
<CVendor>Atmel</CVendor>
12-
<CVersion>1.2.0</CVersion>
13-
<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
14-
<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
15-
<Description></Description>
16-
<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
17-
<d4p1:anyType i:type="FileInfo">
18-
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.209\include</AbsolutePath>
19-
<Attribute></Attribute>
20-
<Category>include</Category>
21-
<Condition>C</Condition>
22-
<FileContentHash i:nil="true" />
23-
<FileVersion></FileVersion>
24-
<Name>include</Name>
25-
<SelectString></SelectString>
26-
<SourcePath></SourcePath>
27-
</d4p1:anyType>
28-
<d4p1:anyType i:type="FileInfo">
29-
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.209\include\avr\iom328p.h</AbsolutePath>
30-
<Attribute></Attribute>
31-
<Category>header</Category>
32-
<Condition>C</Condition>
33-
<FileContentHash>UMk4QUzkkuShabuoYtNl/Q==</FileContentHash>
34-
<FileVersion></FileVersion>
35-
<Name>include/avr/iom328p.h</Name>
36-
<SelectString></SelectString>
37-
<SourcePath></SourcePath>
38-
</d4p1:anyType>
39-
<d4p1:anyType i:type="FileInfo">
40-
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.209\templates\main.c</AbsolutePath>
41-
<Attribute>template</Attribute>
42-
<Category>source</Category>
43-
<Condition>C Exe</Condition>
44-
<FileContentHash>GD1k8YYhulqRs6FD1B2Hog==</FileContentHash>
45-
<FileVersion></FileVersion>
46-
<Name>templates/main.c</Name>
47-
<SelectString>Main file (.c)</SelectString>
48-
<SourcePath></SourcePath>
49-
</d4p1:anyType>
50-
<d4p1:anyType i:type="FileInfo">
51-
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.209\templates\main.cpp</AbsolutePath>
52-
<Attribute>template</Attribute>
53-
<Category>source</Category>
54-
<Condition>C Exe</Condition>
55-
<FileContentHash>YXFphlh0CtZJU+ebktABgQ==</FileContentHash>
56-
<FileVersion></FileVersion>
57-
<Name>templates/main.cpp</Name>
58-
<SelectString>Main file (.cpp)</SelectString>
59-
<SourcePath></SourcePath>
60-
</d4p1:anyType>
61-
<d4p1:anyType i:type="FileInfo">
62-
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.209\gcc\dev\atmega328p</AbsolutePath>
63-
<Attribute></Attribute>
64-
<Category>libraryPrefix</Category>
65-
<Condition>GCC</Condition>
66-
<FileContentHash i:nil="true" />
67-
<FileVersion></FileVersion>
68-
<Name>gcc/dev/atmega328p</Name>
69-
<SelectString></SelectString>
70-
<SourcePath></SourcePath>
71-
</d4p1:anyType>
72-
</Files>
73-
<PackName>ATmega_DFP</PackName>
74-
<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.2.209/Atmel.ATmega_DFP.pdsc</PackPath>
75-
<PackVersion>1.2.209</PackVersion>
76-
<PresentInProject>true</PresentInProject>
77-
<ReferenceConditionId>ATmega328P</ReferenceConditionId>
78-
<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
79-
<d4p1:string></d4p1:string>
80-
</RteComponents>
81-
<Status>Resolved</Status>
82-
<VersionMode>Fixed</VersionMode>
83-
<IsComponentInAtProject>true</IsComponentInAtProject>
84-
</ProjectComponent>
85-
</ProjectComponents>
3+
<ProjectComponents />
864
</Store>

0 commit comments

Comments
 (0)