1
00:00:01,100 --> 00:00:02,340
Hello, welcome back.

2
00:00:02,810 --> 00:00:09,440
In this lesson, we shall see how to work with binary semaphores, I have gone ahead to create a new

3
00:00:09,440 --> 00:00:12,320
project here at number 18, binary semaphores.

4
00:00:12,710 --> 00:00:18,140
And this NMT project is Jesco, our Ewart's in our system clock.

5
00:00:18,140 --> 00:00:21,830
In it, there is no ARTUS code here.

6
00:00:22,010 --> 00:00:23,450
We're going to add that together.

7
00:00:23,720 --> 00:00:25,580
This Jesco our Ewart's.

8
00:00:26,540 --> 00:00:32,720
And our system look like I said, OK, so what are we going to do is we going to start off by having

9
00:00:32,720 --> 00:00:41,150
three tasks and we're going to let them all access the, um, the the support at the same time and we'll

10
00:00:41,150 --> 00:00:42,040
see what happens.

11
00:00:42,560 --> 00:00:48,010
But before we use semaphores, we have to include the semaphores header file in our project.

12
00:00:48,500 --> 00:00:54,080
So I'm going to come to our Simms's, always start over here, highlight's this and then.

13
00:00:54,470 --> 00:00:56,720
Right, click select open declaration.

14
00:00:58,910 --> 00:01:05,000
And down here where I have all of the artists component, I'm going to include one for semaphores,

15
00:01:05,450 --> 00:01:14,210
I'll include I can just copy this and then paste it over here and rename this word to semaphores s m

16
00:01:14,450 --> 00:01:20,000
p h are such that we have semaphores that each like this.

17
00:01:22,930 --> 00:01:30,880
Once that is done, I'm going to come over here to may not see and then I'm going to start off by creating

18
00:01:30,880 --> 00:01:31,870
three tasks.

19
00:01:32,380 --> 00:01:34,810
Let's say these are the controller tasks.

20
00:01:35,230 --> 00:01:40,570
We're going to have one for blue, one for yellow and one for red.

21
00:01:41,590 --> 00:01:44,260
So I'll create those tasks.

22
00:01:45,100 --> 00:01:48,690
Each task would have a stack size of one hundred and two.

23
00:01:48,700 --> 00:01:51,500
All have the same priority.

24
00:01:51,550 --> 00:01:55,300
So this what we have, we have three tasks created.

25
00:01:56,310 --> 00:02:02,250
We have read a little controller task yellowbelly the controller task and then the controller task is

26
00:02:02,250 --> 00:02:05,800
the name were given the task function that we should implement later.

27
00:02:06,450 --> 00:02:09,270
We also going to create a binary semaphore.

28
00:02:10,320 --> 00:02:16,260
Before we do that, we're going to declare a Hando to hold the binary SEMAFO, I'm going to copy this

29
00:02:17,100 --> 00:02:17,640
and.

30
00:02:19,330 --> 00:02:25,630
Paste over here, we have X binary SEMAFO, that's the name of the SEMAFO Hondo, I'm also going to

31
00:02:25,630 --> 00:02:30,820
declare task profiler's that we shall use to profile our tasks.

32
00:02:31,770 --> 00:02:39,450
So we're going to have one for each we first use TYPEDEF to rename it to task profiler's such that whenever

33
00:02:39,450 --> 00:02:42,840
we want to see it, we can simply type this word.

34
00:02:42,840 --> 00:02:49,800
Task profiler, I'm going to declare red profile, yellow ality profile and blue ality profiler, and

35
00:02:49,800 --> 00:02:54,120
we shall drop each profiler in each of the task functions.

36
00:02:55,640 --> 00:03:03,740
So once we've created our tasks and our semaphores, we go ahead and start the scheduler and we do this,

37
00:03:03,740 --> 00:03:05,330
of course, using our V task.

38
00:03:07,250 --> 00:03:09,350
Start such a function like this.

39
00:03:09,590 --> 00:03:17,000
OK, so now we have to implement the task functions, we start off with the first one, we're going

40
00:03:17,000 --> 00:03:19,220
to have the red alert controller task.

41
00:03:21,030 --> 00:03:25,740
And then it's going to have the wah wah loop in here, the infinite loop.

42
00:03:27,720 --> 00:03:38,310
OK, and then we going to copy this and then I'll change the word read here to Blue Sajdah, we create

43
00:03:38,310 --> 00:03:41,430
the task function for blue ality controller.

44
00:03:42,610 --> 00:03:49,660
And then I'm going to paste this over here and then change the word red to yellow.

45
00:03:53,040 --> 00:03:55,440
Such that we have yellow controller.

46
00:03:57,180 --> 00:04:01,110
I'm going to copy the function prototypes and put them on the topia.

47
00:04:02,410 --> 00:04:03,610
This is the one for red.

48
00:04:05,990 --> 00:04:07,220
This is the one for blue.

49
00:04:09,800 --> 00:04:11,900
And then we grabbed the one for yellow.

50
00:04:13,930 --> 00:04:18,580
Like this and also remember, all our tasks have the same priority.

51
00:04:19,790 --> 00:04:20,290
OK.

52
00:04:22,290 --> 00:04:27,150
So what are we going to do is we going to drop the profiler's in each of them?

53
00:04:29,250 --> 00:04:35,160
So I'm going to copy, read a little profiler, and then I'll come over here to read aloud and then

54
00:04:35,160 --> 00:04:40,010
I'll C++, then I'm going to grab yellowbelly the profiler.

55
00:04:40,890 --> 00:04:41,760
Now come here.

56
00:04:43,370 --> 00:04:47,660
And yellow led and then plus plus, you know, grup.

57
00:04:48,590 --> 00:04:52,010
Blue lady profiler will come here in blue.

58
00:04:53,510 --> 00:04:54,980
And then plus, plus.

59
00:04:56,620 --> 00:04:57,880
Put a semicolon here.

60
00:05:02,450 --> 00:05:03,020
OK.

61
00:05:05,200 --> 00:05:12,310
So currently, our tasks does just one thing, it's incremental, this global variable, each of them

62
00:05:12,310 --> 00:05:14,620
have their own global variables that the increment.

63
00:05:15,220 --> 00:05:20,200
But we what are we going to do is we're going to let each task take the SEMAFO we've created.

64
00:05:21,200 --> 00:05:27,380
They take the SEMAFO and then they go ahead to increment their respective global variable, if they've

65
00:05:27,380 --> 00:05:29,440
not taken a SEMAFO, they cannot do that.

66
00:05:30,020 --> 00:05:34,400
So I'm going to surround each increment with our.

67
00:05:37,420 --> 00:05:39,970
Which our semaphore code so red.

68
00:05:41,400 --> 00:05:47,640
Task would take the SEMAFO, the name of our SEMAFO is extraordinary SEMAFO, and then we say Portsmouth's

69
00:05:47,650 --> 00:05:49,890
delay give given the maximum delay here.

70
00:05:49,890 --> 00:05:55,530
So it would first have to take the SEMAFO before its increment once it's done incrementing.

71
00:05:57,100 --> 00:06:07,630
We can go ahead and give back to SEMAFO and then the next task will take the SEMAFO Blue and then it

72
00:06:07,630 --> 00:06:13,180
would after is taken to semaphores you go ahead and run its code, which is simply to increment its

73
00:06:13,180 --> 00:06:14,020
global variable.

74
00:06:14,170 --> 00:06:17,920
Once it's done, it will give back to semaphores so that the next one can take it.

75
00:06:18,310 --> 00:06:22,150
The next the final, which is the next is this one yellow.

76
00:06:22,180 --> 00:06:23,290
It will take the SEMAFO.

77
00:06:23,650 --> 00:06:26,070
Once it is done, it will give back to some awful.

78
00:06:27,910 --> 00:06:30,710
OK, let's run this and see what we have.

79
00:06:31,390 --> 00:06:33,250
I'm going to click over here to build.

80
00:06:40,540 --> 00:06:41,780
It's built successfully.

81
00:06:41,890 --> 00:06:49,660
I'm going to right click and see debuggers ASTM 32, Coatex M iSelect 18 over here.

82
00:06:51,510 --> 00:06:52,500
And then OK.

83
00:06:58,700 --> 00:07:00,440
Then I'll click switch over here.

84
00:07:03,580 --> 00:07:10,470
And what I'm going to do is come to our live expressions window over here are clear, OK?

85
00:07:12,100 --> 00:07:21,100
OK, everything about that, Cledus, and then let's add our profiler's again, red profiler, we are

86
00:07:21,370 --> 00:07:22,870
yellow profiler.

87
00:07:26,080 --> 00:07:27,850
We are blue profiler.

88
00:07:29,920 --> 00:07:31,960
OK, I'm going to click to run Elkwood.

89
00:07:33,330 --> 00:07:34,440
I'm running out code.

90
00:07:36,640 --> 00:07:37,670
But nothing is happening.

91
00:07:37,690 --> 00:07:41,200
I'm going to click to pause to see what the issue may be.

92
00:07:42,730 --> 00:07:46,180
Well, OK, we're running around, could it?

93
00:07:46,350 --> 00:07:53,950
Yes, because we are brought to the kudos for being in a separate program is being executed here.

94
00:07:56,920 --> 00:07:57,850
Oh, stop this.

95
00:07:59,630 --> 00:08:01,940
We do not have an AQ code here.

96
00:08:08,510 --> 00:08:13,970
So I'm going to right, click on binary semaphore projects and then build again.

97
00:08:15,020 --> 00:08:15,920
They would project.

98
00:08:17,380 --> 00:08:22,660
It's built successfully, right, click, debug us, select this.

99
00:08:23,640 --> 00:08:26,760
And then a select number 18, see?

100
00:08:32,420 --> 00:08:33,730
Then switch.

101
00:08:39,260 --> 00:08:41,090
And then I'm going to click to run.

102
00:08:43,080 --> 00:08:45,420
We still stuck our collective paws.

103
00:08:47,830 --> 00:08:49,700
And we are brought to the queue again.

104
00:08:50,330 --> 00:08:51,400
OK, let's find out.

105
00:08:53,910 --> 00:08:54,840
We're going to stop this.

106
00:08:56,880 --> 00:09:03,040
OK, so it's an anomaly which we've committed before or I have committed before.

107
00:09:03,420 --> 00:09:08,000
So when we came here, I mentioned we've created a SEMAFO, but we actually haven't.

108
00:09:08,820 --> 00:09:10,710
I failed to create the SEMAFO.

109
00:09:10,710 --> 00:09:14,380
So that is why we are being sent to that location whenever we post.

110
00:09:14,760 --> 00:09:22,830
So over here, reinitialize we print system in it and we create our SEMAFO X creates binary.

111
00:09:22,830 --> 00:09:28,020
And then we started Hando in our semaphore Hondo before we go ahead to create our tasks.

112
00:09:28,770 --> 00:09:30,960
So I'll click here to build.

113
00:09:33,000 --> 00:09:34,230
It's argued successfully.

114
00:09:35,900 --> 00:09:37,640
I'll click to go to debark.

115
00:09:43,700 --> 00:09:45,140
And then switch.

116
00:09:49,340 --> 00:09:51,290
OK, now a click to run.

117
00:09:56,920 --> 00:09:58,240
OK, let's pause and see.

118
00:10:00,650 --> 00:10:01,630
I said no.

119
00:10:01,700 --> 00:10:02,530
Over here.

120
00:10:04,430 --> 00:10:05,660
Exhumed pended.

121
00:10:05,920 --> 00:10:07,130
OK, I'm going to stop.

122
00:10:09,850 --> 00:10:17,380
No, what we've just experienced is a very common issue in real time operating systems when dealing

123
00:10:17,380 --> 00:10:25,720
with semaphores and other things like mutex, which are a form of SEMAFO, what we are experiencing

124
00:10:25,720 --> 00:10:30,170
now is known as a deadlock or a deadly embrace.

125
00:10:30,640 --> 00:10:31,460
Let me explain.

126
00:10:32,530 --> 00:10:38,600
So you see, we start over here by creating the Red Alyda controller task.

127
00:10:39,400 --> 00:10:43,180
So this is going to be the first task to run since they all have equal priority.

128
00:10:43,780 --> 00:10:50,260
When this task tries to run, it would come over here expecting to receive a SEMAFO because we have

129
00:10:50,260 --> 00:10:51,490
the Zema for take.

130
00:10:53,890 --> 00:10:55,960
But no one is given the SEMAFO.

131
00:10:57,100 --> 00:11:04,810
So this function wants to take a SEMAFO and then run its code and then give back to SEMAFO, but before

132
00:11:04,810 --> 00:11:07,980
it takes the SEMAFO, the SEMAFO has to be given.

133
00:11:08,680 --> 00:11:12,580
So essentially all our tasks are waiting for a SEMAFO.

134
00:11:13,240 --> 00:11:15,220
Each of them can give us a map for once.

135
00:11:15,220 --> 00:11:16,420
They've taken it by.

136
00:11:16,420 --> 00:11:23,230
They are waiting for each of them to give the SEMAFO because if our function started from give the next

137
00:11:23,230 --> 00:11:28,810
function, if our task gave the SEMAFO, then this blue could take it.

138
00:11:29,440 --> 00:11:34,340
Essentially each of them are waiting for a resource that they all have access of providing.

139
00:11:34,900 --> 00:11:42,790
So someone has to give the SEMAFO first to to get the ball rolling without starting by giving the SEMAFO,

140
00:11:42,790 --> 00:11:49,090
we would be kept in this deadlock where each task has the ability to give and take the SEMAFO, but

141
00:11:49,090 --> 00:11:50,020
no one is given.

142
00:11:50,710 --> 00:11:53,130
And because no one is given, no one can take.

143
00:11:53,860 --> 00:11:55,300
So what are we going to do is.

144
00:11:56,770 --> 00:11:59,410
We're going to start off when our program starts.

145
00:12:01,500 --> 00:12:07,380
In a red ality, not in our well-worn loop, but in the Red Élodie task, we're going to start off by

146
00:12:07,380 --> 00:12:13,020
giving the SEMAFO so read the function would first give the SEMAFO and then the wall one loop.

147
00:12:13,170 --> 00:12:15,320
We take the SEMAFO and then we proceed.

148
00:12:15,690 --> 00:12:18,290
Let's see if this will solve our Dedlock problem.

149
00:12:18,690 --> 00:12:19,830
I'll click here to build.

150
00:12:27,500 --> 00:12:30,710
It's built successfully, click here to go to the few.

151
00:12:34,500 --> 00:12:35,310
Click to switch.

152
00:12:39,540 --> 00:12:46,800
OK, I'll click here to run, and now as you can see, we have all of our tasks running and we know

153
00:12:46,800 --> 00:12:51,840
it's running because they are all incrementing profiles and you see that they are run in almost equal

154
00:12:51,840 --> 00:12:56,400
amount of time, not entirely equal because one has to.

155
00:12:57,670 --> 00:13:03,340
Perform its computation and then give the SEMAFO for the other one to perform its computation, but

156
00:13:03,370 --> 00:13:05,500
we see that they are all running right.

157
00:13:06,240 --> 00:13:06,700
OK.

158
00:13:07,960 --> 00:13:14,130
They are running what we are going to do is now we've verified that they are all running with a semaphore.

159
00:13:14,140 --> 00:13:19,150
We're going to say when Red takes the SEMAFO red ones, give it back.

160
00:13:19,180 --> 00:13:21,220
So we're going to comment on this line.

161
00:13:21,700 --> 00:13:23,200
Going to click here to build.

162
00:13:27,190 --> 00:13:30,490
It's built successfully, we click here to go to the debug view.

163
00:13:37,190 --> 00:13:38,870
And then we click here to switch.

164
00:13:42,400 --> 00:13:44,500
And then we click here to run.

165
00:13:46,700 --> 00:13:55,490
Now you see that red round was red, just executed once, but it's executed once and got stuck.

166
00:13:55,520 --> 00:13:56,040
Why?

167
00:13:56,210 --> 00:14:00,890
Because when we take a look at our code red took the SEMAFO.

168
00:14:01,880 --> 00:14:03,710
And then it's executed.

169
00:14:05,010 --> 00:14:11,280
And now no one is given the semaphore, Red was supposed to give the semaphore to the next task to run

170
00:14:11,730 --> 00:14:17,820
and then also give the SEMAFO, but because Red didn't give the SEMAFO after its execution, nothing

171
00:14:17,820 --> 00:14:18,870
else is executed.

172
00:14:19,590 --> 00:14:19,980
Right.

173
00:14:20,580 --> 00:14:22,530
So this is another observation.

174
00:14:23,630 --> 00:14:25,800
OK, so we're going to bring this back.

175
00:14:26,090 --> 00:14:31,540
Now, what are we going to do is we go into print zero data.

176
00:14:31,550 --> 00:14:38,150
We're going to let each of the task access the support and print a piece of information read is going

177
00:14:38,150 --> 00:14:48,110
to print this red task and then yellow will print this yellow task and then blue print its own piece

178
00:14:48,110 --> 00:14:49,500
of information.

179
00:14:50,090 --> 00:14:56,360
So this is yellow task from yellow and then blue over here would say.

180
00:14:58,940 --> 00:15:03,010
This is blue Tosk, so this what we have, OK?

181
00:15:06,090 --> 00:15:08,970
So we click over here to build.

182
00:15:11,910 --> 00:15:12,540
And then.

183
00:15:13,530 --> 00:15:14,790
We click here to run.

184
00:15:18,850 --> 00:15:20,950
OK, I'm going to open real term.

185
00:15:24,190 --> 00:15:30,250
This is from our old project, I'm going to Claire and then click to open the port.

186
00:15:32,530 --> 00:15:38,090
Let's see what we have, we have this is red TASC, this is red task, this is red.

187
00:15:38,470 --> 00:15:39,840
How about the rest?

188
00:15:39,850 --> 00:15:40,510
Let's see.

189
00:15:42,670 --> 00:15:43,270
Let's see.

190
00:15:45,370 --> 00:15:49,450
So let's see, so we have this we have just the.

191
00:15:52,330 --> 00:15:55,510
The Red Cross printed its information over here.

192
00:15:55,660 --> 00:16:05,350
OK, so let's see if only the red thread or task is the one executed by observing the profiler's.

193
00:16:05,860 --> 00:16:09,710
That's the way you try to diagnose problems in the real time system.

194
00:16:10,210 --> 00:16:15,520
So I'm going to click here to go to the box you and we're going to see if our profiles are not changing.

195
00:16:19,800 --> 00:16:25,690
So I'm going to come over here, click here to run, and we have just read a little profiler running.

196
00:16:26,430 --> 00:16:28,470
OK, let's see what we have.

197
00:16:34,900 --> 00:16:41,950
So Red takes the the SEMAFO and Red gives the semaphore.

198
00:16:43,280 --> 00:16:50,180
Lou takes the SEMAFO, the blue gives it, however, only red is running, let's comment at our printf

199
00:16:50,180 --> 00:16:52,900
and see if that would solve the issue.

200
00:16:52,910 --> 00:16:56,840
I'm going to comment on the premise that we just added.

201
00:16:57,770 --> 00:16:59,450
Then I'm going to click here to build.

202
00:17:02,670 --> 00:17:03,750
Secured successfully.

203
00:17:05,200 --> 00:17:07,540
Then we click here to go to debark few.

204
00:17:15,490 --> 00:17:16,420
Click here to switch.

205
00:17:21,670 --> 00:17:23,810
Then I'm going to click here to run.

206
00:17:24,290 --> 00:17:26,240
OK, so now it's running.

207
00:17:28,670 --> 00:17:37,400
OK, so with the with a printer to use the printer with stability, I'm going to add the task delay

208
00:17:37,400 --> 00:17:39,530
of one to each function.

209
00:17:40,250 --> 00:17:44,390
OK, so I'm simply going to advertise this one here.

210
00:17:50,130 --> 00:17:53,250
OK, so read LDV Task DeLay.

211
00:17:54,700 --> 00:17:57,610
I'm going to do the same for Lou.

212
00:17:58,650 --> 00:18:01,290
Then I'm going to do the same for yellow.

213
00:18:03,370 --> 00:18:05,620
Like this, and then I'm going to click here to run.

214
00:18:16,690 --> 00:18:19,240
People suggesting that I'm going to.

215
00:18:20,280 --> 00:18:23,060
Yeah, that's straight by running Facebook, click here to read.

216
00:18:26,450 --> 00:18:29,390
It's a 20 to percent year like computer running low.

217
00:18:31,470 --> 00:18:32,860
OK, it's finished running.

218
00:18:32,880 --> 00:18:34,080
Let's see real tim.

219
00:18:35,540 --> 00:18:42,200
OK, I'm going to open the port and now you can see we have each and every one of them type in their

220
00:18:42,200 --> 00:18:49,910
respective message, we have over here Red TASC, Blue TASC, Yellow TASC, Red Task, blue tasc, yellow

221
00:18:49,910 --> 00:18:52,600
tasc, red, blue, yellow, red, blue.

222
00:18:52,610 --> 00:18:55,160
It's all that one after the other.

223
00:18:55,610 --> 00:19:00,010
OK, so let's see what happens when we see no more semaphores.

224
00:19:00,020 --> 00:19:02,000
We don't need semaphores in our system.

225
00:19:04,560 --> 00:19:12,330
We're going to comment out the SEMAFO take and SEMAFO give functions in our code, in all of the tasks

226
00:19:12,870 --> 00:19:18,960
read, and now we comment it out of blue and then we comment it out of yellow as well.

227
00:19:19,200 --> 00:19:19,800
Like this.

228
00:19:21,300 --> 00:19:23,820
Once that is done, I'm going to click here to build.

229
00:19:26,040 --> 00:19:33,450
It's built successfully and I'm going to click here to run and then I'm going to open to.

230
00:19:37,390 --> 00:19:39,190
It's still downloading onto the board.

231
00:19:40,610 --> 00:19:49,100
It's done downloading, going to open real time here, OK, real time is opened, but this is what we

232
00:19:49,100 --> 00:19:49,580
get now.

233
00:19:49,610 --> 00:19:56,810
It's jumbled up, right, because all of the threads are trying to access the serial port.

234
00:19:57,980 --> 00:20:04,730
Meanwhile, the support is a single resource one has to access at the time we were using the SEMAFO

235
00:20:05,180 --> 00:20:08,030
to enable, there is just a single access.

236
00:20:08,210 --> 00:20:11,600
You can think of the support or the you ought to be a bathroom.

237
00:20:11,900 --> 00:20:13,610
You can have just one occupant.

238
00:20:14,150 --> 00:20:19,910
The occupant has to take the key, opened the door, use the bathroom and then return to key.

239
00:20:20,660 --> 00:20:28,760
Taking the key is similar to our semaphore take function here and then printing this yellow task is

240
00:20:28,760 --> 00:20:30,220
like using the bathroom.

241
00:20:30,230 --> 00:20:33,350
And once you are done, you come out of the bathroom and you give back.

242
00:20:33,350 --> 00:20:38,750
The key is similar to our SEMAFO give back because now the door is open.

243
00:20:38,750 --> 00:20:40,370
There is no key associated.

244
00:20:41,060 --> 00:20:45,110
Everyone is trying to enter the bathroom and mess it up at the same time.

245
00:20:45,140 --> 00:20:48,190
So we have this type of display on our zero program.

246
00:20:48,650 --> 00:20:53,450
Okay, so obviously the best thing to do in this case is to use the SEMAFO.

247
00:20:53,750 --> 00:21:00,890
We would see rather than have semaphore take and SEMAFO Give would see a semaphore mutex that allows

248
00:21:00,890 --> 00:21:04,070
us to use a single API to.

249
00:21:05,380 --> 00:21:11,830
To do the same thing that we use in these two SEMAFO APIs, take and give to achieve, we use the mutex

250
00:21:11,830 --> 00:21:16,390
to to achieve the same thing, but this time we'll call a single function.

251
00:21:17,040 --> 00:21:24,520
OK, but we've seen the the benefits of semaphores over here in accessing shared resources and we've

252
00:21:24,520 --> 00:21:28,130
seen how semaphores can be used to block a part of code as well.

253
00:21:28,690 --> 00:21:31,360
So we've done a number of experiments with semaphores.

254
00:21:31,360 --> 00:21:38,710
I would just build our projects again and take it back to its SEMAFO nature before we conclude this

255
00:21:38,710 --> 00:21:42,820
particular lesson of with the project go into.

256
00:21:44,390 --> 00:21:45,380
Click here to run.

257
00:21:51,900 --> 00:21:53,280
It's downloading onto the board.

258
00:21:55,030 --> 00:21:55,930
I'll clear this.

259
00:21:59,910 --> 00:22:07,860
And it says waiting for the debugger and then we have 97 percent here to almost complete.

260
00:22:09,400 --> 00:22:12,730
OK, it's complete now I'm going to open our port.

261
00:22:14,560 --> 00:22:19,150
And I'm going to open again, and as you can see, we are back to normal operation.

262
00:22:23,420 --> 00:22:32,420
OK, this happens when you try to restart the port in the middle of a transfer, so we are back to red,

263
00:22:32,420 --> 00:22:34,760
yellow, blue, red, yellow, blue again.

264
00:22:35,000 --> 00:22:39,170
OK, so this order is we've explored binary semaphores.

265
00:22:39,890 --> 00:22:41,210
That's all there is for this lesson.

266
00:22:41,210 --> 00:22:44,210
If you have any questions, leave them in the questions and answers area.

267
00:22:44,270 --> 00:22:45,020
I'll see you later.

268
00:22:45,050 --> 00:22:45,770
Have a nice day.
